I have T7 Pro and am using the Delphi XE10.2.3 and the Delphi LJM wrapper for communications. My communication code is based directly on the example code that was provided.
The issue I am experiencing is that I randomly experience issues in getting communication to start and run. While my production model will use WIFI, and I have done most of my testing over WIFI I have experienced the same issues with USB.
Prior to commencing a connect process, I ping the static IP address assigned to the device and wait for 5 successful responses. I then initiate a connect command. Once connected, I begin reading the AN0-2 channels at a rate of 10 times a second.
When the communication issues occur, the connection will sometimes fail, and no read events will succeed. Othertimes, the connect will succeed and the first few packets of data will be read successfully. And then randomly the connection will drop out.
However when successful, the system is rock solid stable. I have ran saturation testing for more than 48 hours without any communication errors.
Do you have any advise on how I can improve the communication connect reliability to the device?
Also, instead of using a wrapper, I would much rather have a delphi unit that communicates to the IP of the device directly based on indy TCP or UDP communications. Have you published the communication protocol somewhere such that I can write my own dedicated communications unit?
Cheers,
Ian
When the communication issues occur, the connection will sometimes fail, and no read events will succeed. Othertimes, the connect will succeed and the first few packets of data will be read successfully. And then randomly the connection will drop out.
Are you doing a specific open? In other words, do not pass "any" for any of the parameters, but instead pass "t7", "ethernet", and the IP address. If you were just having trouble with open this would be our first suggestion, because as soon as you use an "any" LJM has do do searching which does an admirable job but some networks really fight it.
Your observation of successfully connecting and then losing communication after a few packets is very odd. If you still see this with the specific open we will need to dig deeper.
Also, instead of using a wrapper, I would much rather have a delphi unit that communicates to the IP of the device directly based on indy TCP or UDP communications. Have you published the communication protocol somewhere such that I can write my own dedicated communications unit?
Yes, you simply use Modbus TCP which is a quite simple protocol. It is very easy to do everything except stream mode which can be pretty complex to try to implement yourself. See "Direct Modbus TCP" here:
https://labjack.com/support/datasheets/t-series/communication
You might find a Modbus TCP libary for Delphi, or it is easy to build the packets yourself.
https://labjack.com/support/software/examples/modbus
Start by writing and reading the test registers.