Is there a C header file (.h) that contains the T7 Modbus Map? I'm writing a C program that interfaces with a T7 and I find myself typing a lot of lines like: #define DAC1 1002
Is there an all inclusive header file I can download so I don't have to do this by hand? Thanks for your help!
Hello,
There is not (currently) a .h header file, but there are the LJM name read/write functions, which allow you to use a register's name instead of its address/type.
This doesn't provide static code analysis (since you don't really know whether or not you typed the name correctly). If you'd like a header file for static code analysis, we could see about making one and distributing it. Would that be beneficial to you? Also, thanks for bringing this to our attention!
It would definitely be beneficial to us. We are using an existing Modbus code set to talk directly to the T7 (without LJM), but I can see how a header file would also be useful for the LJM "Address Functions" to provide static code analysis.
Thanks for your input. We'll get something to you soon.
Thanks! We would greatly appreciate that.
Hello,
We've generated a header file, which is temporarily available here:
https://s3.amazonaws.com/ljrob/temp/LabJackMModbusMap.h
Please try it out and let us know if you have any feedback at all. At some point, we may distribute this .h in regular LabJack LJM software installers.
Also, you can use the LabJack LJM Modbus Map tool to find the register you're looking for. From there, the register's address constant will be named "LJM_register_name_ADDRESS". (Perhaps we should shorten the ADDRESS to ADDR? Etc? Let us know what you think.)
This is exactly what we were looking for. Thanks for your help!