LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conflict using Labview and a serial port

Hi All,
I am developing a 6 circuit product using Labview and a serial port. 2 of the circuits are identical ( 1 configured as a 14 channel Radio Control servo controller, the other a 14 channel data acquisition board ). 1 of the circuits is a dongle connected to a PC via serial cable/port. The other 3 circuits are identical RF comms devices allowing dongle and 14 channel circuits to communicate.

The serial port is configured relaitive to the attached vi.

The idea is to capture logged data from one 14 chan board and transmit it to the 14 chan servo controller board in "real time". So for example a biped robot can mimic movements of a user wearing a leg harness.

The circuitry and embedded code is virtually finished and I have just started to connect this new hardware to my prebuilt Labview routine.

I can power up the circuits using Hyperterminal for a couple of hours and keep the connection. This means the PC receives frames of 42 bytes from the logger at 100 hz and is able to transmit frames to the servo controller at 50 hz.

I dont know how Hyperterminal works in order to create this reliable connection but I have tried to recreate the same functionality in Labview but keep losing the link. Resetting the dongle regains the link. I find I can run both the logger and servo controller separately but as soon as I connect both at the same time I lose the connection within seconds.

I undestand the dongle is set to receive logger frames until a write request occurs at which point receive is put on hold untill the write is finished. The RF side of things is configured back and forth as Tx and Rx. Clearly it can cope with rapidly switching this way when Hyperterminal is used.

Simply, how do I achieve the same function as Hyperterminal ( I'm guessing ).

I have struggled before to get Labview doing Rx and Tx at the same time in a time critical application and suspect this is a similar type of issue. I suspect this is partly due to my not understanding thoroughly the workings of a serial port.

Thanks in advance

Best Regards

Chris - Robotic Systems.
Download All
0 Kudos
Message 1 of 2
(2,631 Views)
Chris,

Some subVIs were missing from your .llb file so I may have overlooked something.

What I would try is to put the serial read and write into separate, parallel loops. Then each could operate as required without waiting or interferring with the other. Also, read only the number of bytes actually present, not a fixed 40. If only 35 are present the read VI may wait for the other 5 to show up.

Pass the data from the read and write loops to/from another parallel loop which does the processing, such as framing and any data format translation which may be required. What I am recommending is essentially a state machine architecture.

Lynn
0 Kudos
Message 2 of 2
(2,631 Views)