Rodney Posted August 24, 2017 Share Posted August 24, 2017 Hi I am trying to collect data from a device but cannot get the correct I/O type - always getting an Illegal Data Address error The device documentation (attached see p15) is very explicit and I can replicate the example provided using modbus poll software I have tried all 12 type 3 I/O (in sheer frustration!!) but I cannot get any data from the 3 registers ox9013-9015 (Decimal 36883-36885) I have tried both the Channel approach and a group read sequence but with no luck ( I got a group read to work with other of registers so I am confident my syntax in the sequence is correct) please refer to the 2 other attachments your guidance most appreciated Rodney ControllerProtocolV2.4.pdf Link to comment Share on other sites More sharing options...
AzeoTech Posted August 24, 2017 Share Posted August 24, 2017 The problem has to do with Modbus addressing. There are two types and DAQFactory sometimes gets confused trying to determine which type you are using. There are other forum posts that go into this in detail, but basically, if you try and read a tag in the 30,000-49,999 range, DAQFactory thinks you are using 1 indexed addressed and so strips the 10,000's place and subtracts 1. So 36883 becomes 6882. But in your case, 36883 is just 36883. To get DAQFactory to stay in the 0 indexed addressing, simply add a manual read of an address in the 50,000+ range once in your auto-start sequence: try device.mppt.readholdingS16(10,60000,1) catch() endcatch Link to comment Share on other sites More sharing options...
Rodney Posted August 27, 2017 Author Share Posted August 27, 2017 Thanks - that worked one more question in relation to this Once I include the above code in a sequence does DAQFactory then revert back its default mode when the sequence ends? if not how do I turn it off as I have other equipment in the project that requires DAQFactory to be in default mode Rodney Link to comment Share on other sites More sharing options...
AzeoTech Posted August 29, 2017 Share Posted August 29, 2017 No, it will stay in 0 indexed mode as long as the application is loaded. If other equipment uses the 40,001 notation, you should just translate the addresses to 0 notation. I personally always do that. It is easy to do: just strip off the 10,000's place, and subtract 1. So, 40,001 becomes 0. 31843 becomes 1842. etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.