This is an advanced section. Visit it only after you’ve outgrown the material on the LJFuse page.
Requirements
This section requires LJFuse created on 9/16/2010 or later.
Timers and Counters with Modbus
In this section, we will use LJFuse with the timers and counters on a U3. By default, LJFuse does not provide an interface to timers and counters. There are no connections for them in the connection/ subdirectory, and there are no Modbus addresses for them in the modbus/ directory. What we will do in this section is create the files in the modbus/ directory for the necessary Modbus registers. While working through this section, you’ll need a copy of the LabJack Modbus Map:
http://labjack.com/support/modbus
open in a new window.
Accessing the Modbus directory
All the commands in this section work only in the modbus/ subdirectory of a device, so go there first.
# Change to the modbus/ directory
$ cd root-ljfuse/My\ U3-LV/modbus/
$ pwd
/Users/mikec/src/LJFuse/root-ljfuse/My U3-LV/modbus
# View the Modbus registers
$ ls
0 5002 6002 6006 6102 6106
2 6 6003 6007 6103 6107
4 6000 6004 6100 6104 README.txt
5000 6001 6005 6101 6105
Using the counters
Looking at the LabJack Modbus Map (you do have that open, right?), notice that register 50502 is a “Counter Mask”. We can write to that register to enable a counter.
But wait, look at the output of “ls” above. There is no file for 50502. This is the key point of this whole section:
In the modbus/ directory, you may create files for the Modbus addresses that are missing.
p.
Comments
No comments yet. Speak up. We're listening.