Industry Online Support
Technical Forum
7/28/2013 1:23 PM | |
Posts: 19 Rating: (0) |
Hi, i am learning SCl and i am searching how to enter a datablock for example: in FDB and LAD you can use DB3.DBX0.0 how can you do this in SCL? |
7/31/2013 3:15 PM | |
Posts: 74 Rating: (31) |
If you want to use absolute (numeric) adressing, have a look here: http://support.automation.siemens.com/WW/view/en/76347191http://support.automation.siemens.com/WW/view/en/59623720 But it is better as mentioned byhdhosseinito use symbolic, which means you write the name of the data block, and followed after a dot the name of the specific row in the DB. Example: "MyDataBlockName".MySpecificRow := TRUE; Note, that you can access parts of a symbolic element as well - this is NEW compared to Step7 Classic, where it wasn't possible to access element parts of a symbolic element (except for instance data using AT) Set the second bit in a DWORD to TRUE "MyDataBlockName".MySpecificDWORD.x1 := TRUE; Set the first byte in the DWORD to hex value 4: "MyDataBlockName".MySpecificDWORD.b0 := B#16#4; Set the second word in the DWORD to FF_ "MyDataBlockName".MySpecificDWORD.w1 := W#16#FF; Set the complete string to ABC: "MyDataBlockName".MySpecificString := 'ABC'; Set the fourth character in a string to the letter B: "MyDataBlockName".MySpecificString[4] := 'B'; The same can be done for other element types as well.
|
This contribution was helpful to1 thankful Users |
Follow us on