10/15/2019 1:39 PM | |
Joined: 4/3/2019 Last visit: 3/4/2024 Posts: 8 Rating: (0) |
Hello to everybody, I have a problem with one paremeter of MB_Master. It is "DATA_ADDR". I am trying to read a level instrument to get the levelfill variable. I checked the manual of the instrument (manual attached) and I can not see what modbus address I have to put, either holding register address (400001,40002,40003, etc) or input register address (30001,30002, etc)? Anyone knows what address is it? Note: holding register page 81. Thank you, Regards, Alvaro Attachment47252-EN-180329_EN (Solid Sensor).zip (58 Downloads) |
Last edited by: Alvaro333 at: 10/15/2019 17:24:49 |
|
12/1/2019 3:54 PM | |
Joined: 9/27/2006 Last visit: 4/23/2024 Posts: 12257 Rating: (2665) |
Hello Alvaro; Your procedure appears correct, at first glance. However, the format that Vega shows is Little-endian, whereas the data format of the S7-1200 is Bid-Endian. If this means little to you, have a look at the following discussion, you might find it interesting: When you read the final (REAL, floating-point val;ue) from the Vega sensor, it may show a number that is completely wrong, such as 1,xxx e-27. That shows that the byte order must be swapped in your program. There is a "Swap" instruction (for word- or Dword-sized values) that you can use to convert a Little-Endian value to a Big-Endian format (and vice-versa), changing the byte order; see the attachment below, taken from the S7-1200 system manual. https://support.industry.siemens.com/cs/us/en/view/109759862 Hope this helps, Daniel Chartier |
12/1/2019 10:42 PM | |
Joined: 3/28/2010 Last visit: 4/17/2024 Posts: 1029 Rating: (211) |
Sorry, I missed your reply. 1. The level value (PV) might very well be in register 106/107 already, by default. If it were me, I'd try it reading 106/107 first to see what's there. If it is a null value or some other value, then yes, you need Pactware to parameterize register 106/107 with the PV. 2. I'm not Siemens guy so I have no idea what Mode=0 is. But an address of 30107 could be the right syntax, or it could also be 30106. Try it and see. If 'Len=2' means "read two registers", then yes, that is OK. 3. byte/word order for floating point True Big Endian (Motorola processors) byte order is ABCD. True Little Endian (Intel processors) byte order is DCBA. Vega's floating point byte order is CDAB, known as "Little endian byte swap" format. Vega 69 allows for any of the four byte/word order formats for 32 bit floating point values. But the order defaults to Big Endian (ABCD); see the attachment. I'm not sure if Pactware can change the FP byte/word format or not, but you can write a value to (4)3000 or (4)03000 to change the FP format to one of the other FP formats, whichever is most suitable, (doesn't require conversion). Or, deal with the byte word order in the S7. AttachmentVega has selectable word-byte order for FP values, defaults to Big Endian.JPG (106 Downloads) |
Follow us on