01-18-2024 01:18 PM
Hello everyone,
I am trying to establish a method in which a dialogue box should pop up when XNET connection is lost, example someone trips over CAN cable and it falls off.
I though it would work similar to TCP where I can use the error out from "Read" and use that to generate a pop up, but this logic is not working for XNET.
The Error state of XNET Read do not change to True when the cable is disconnected. Can someone tell me why this happens or there is a different way to detect connection loss in XNET?
I at least expected 40 to turn to true as my XNET Read is inside th
01-19-2024 09:38 AM
You wired -1 to 'number to be read', which simply returns all frames received so far. This is similar to the TCP read with option 'Immediate', which also returns no error if nothing is received.
Use a positive number to force to read that amount of frames. In that case, you also have to wire a positive number to the timeout terminal.
The frames returned contain a typedef 'type', which usually is 'CAN data', but can also indicate 'bus error'. This might also be useful, however, you must set 'Interface/Bus error frames to Input stream' in a proberty node of the session.
01-22-2024 02:13 PM
Hello thank you for your reply.
In my application it was necessary to read "all frames" hence I had to stick with -1.
Solution with respect to my application: I am using LabVIEW 2019.
Use the bus status as a trigger for your tasks.