So I have just started playing with the LabJackM-1.0900-Raspbian-Linus-armhf installation package on a Pi 3.
I've been able to follow the compilation method laid out in the README file (via Scons/Python). The existing examples that I've tried work for me, and I've figured out how to add scripts to the SConstruct file to include when using the "./make.sh" command. My scripts have just been modifications of the existing examples thus far, but I need to go further.
I'm trying to add functionality like DAC and various AIN_EF. I've done this stuff in Lua onboard a T7-pro using the register map. How do I get this to happen on the Pi? I'm not even sure what language is being utilized in the examples (C?). Is there a straight forward way to translate my existing Lua scripts into versions that will run on the Pi? Main reason behind the potential move to a Pi is that I am running out of memory on the T7-pro when trying to execute large scripts (especially those utilizing FlexRMS...)
Any resources or advice would be greatly appreciated.
Thanks,
-Jason
It sounds like you are using the C/C++ examples. The C/C++ examples, and most of our examples, are using the LJM library. This library is installed onto your Pi running Linux with the LabJackM-1.0900-Raspbian-Linus-armhf installer. The LJM library provides a way to access your T7 over USB or Ethernet. sending/receiving Modbus command/responses. LJM library documentation is here:
https://labjack.com/support/software/api/ljm
For all examples we provide for various languages, go here:
https://labjack.com/support/software/examples/ljm
They will demonstrate LJM library usage. For reading/writing one register, use these LJM functions (similar to LUA functions MB.R and MB.W):
https://labjack.com/support/software/api/ljm/function-reference/single-v...
For writing multiple registers in one call (one USB command/response), use these functions:
https://labjack.com/support/software/api/ljm/function-reference/multiple...
So to quickly demonstrate, here is one way to set DAC0 using the register name. Refer to the examples for a full demonstration as this only shows the one call:
error = LJM_eWriteName(handle, "DAC0", 3.3); //Set DAC0 to 3.3 V
Alternatively if you prefer using register addresses, then:
error = LJM_eWriteAddress(handle, 1000, LJM_FLOAT32, 3.3); //Set DAC0 (address 1000) to 3.3 V