Rodney Posted April 25, 2018 Share Posted April 25, 2018 Hi I have an issue with the correct I/O type to use - the manual with the equipment appears to be inconsistent - however my newbie status maybe the issue.... I have 3 different channels that according to the manual all use the same data type - integer - see attached PDF - MTM100FM_ extract I have set up all 3 as readholding U16 - see channels attachment (note channels are actually 1 less than the manual due to Modbus numbering) the equipment has a display that shows all the 3 channels Signal Quality range 90-95 Signal Strength Up range 80 -86 Signal Strength down range 80-86 if I do a to.byte conversion on Signal Quality per the manual I get the correct reading - somewhere between 90-95 per the display - so readholding U16 appears to be correct the up and down are giving a reading in the 3500 range (see attachments) - outside the 0-2047 integer range of the manual Am I using the correct I/O type? if not what should I be using? Rodney MT100FM_Extract.pdf Link to comment Share on other sites More sharing options...
AzeoTech Posted April 27, 2018 Share Posted April 27, 2018 Well, technically an "Integer" means a signed integer, so S16, but in this case it probably doesn't matter because you are under 32767. It might be that you have to strip the high order bytes, so just apply a conversion of Value & 0x7ff. But otherwise there is nothing wrong from the DAQFactory side. Link to comment Share on other sites More sharing options...
Rodney Posted April 29, 2018 Author Share Posted April 29, 2018 Hi thanks for the response but I have a question re the syntax in your reply you have Value & 0x7ff - is this a typo? Only reason ask is that in your reply to a post I made re BCD conversion in Sept 2017 you said use Value & 0xff As a non programmer I am not sure of the logic /syntax of this low and High byte (Value >> 8) conversions any chance you can give a quick explanation or point me to where in the Manual where these conversions are? Rodney Link to comment Share on other sites More sharing options...
AzeoTech Posted May 1, 2018 Share Posted May 1, 2018 No, you said the range was 0 - 2047. 2047 is 0x7FF in hex. Doing Value & 0x7ff strips off any bits above 2047. Sometimes, devices that aren't a full 16 bit, will use the upper bits for status or other things, which may be why you are getting numbers in the 3500 range. Link to comment Share on other sites More sharing options...
Rodney Posted May 1, 2018 Author Share Posted May 1, 2018 Thanks Matt I asked a similar type question to the manufacturer (yet to receive a reply) so I must be sort of getting this now...... Rodney Link to comment Share on other sites More sharing options...
AzeoTech Posted May 1, 2018 Share Posted May 1, 2018 Yeah, I can't guarantee that stripping the high order bits off is going to solve the problem. It is just an educated guess on something to try. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.