LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication trobule

Hello,

 

I am having a problem with serial communication with external device.

I use attached VI to send and receive via serial.

 

I run this application on two identical hardware setups, and it won't work on one of them. When I use hyper terminal to communicate, message that is generated by the VI gets response.

ON second station, when the VI is run it is blocking COM1 port, so I cannot connect to it with terminal. On the faulty one, it seems that it is not opening the port, because I can use it with terminal.

 

Any ideas? I thought that it may be connected with administrative rights (win 7), but I tried it different ways and it didn't really help.

 

Thank you for your support.

0 Kudos
Message 1 of 3
(2,815 Views)

First, only one program can use a serial port at any given time. That program must close the port before any other program can use it. It is very possible that you have two different programs trying to access the same port at the same time. Since your program does not do any error checking or reporting, you have no idea of whether that might be the problem.

 

Next, it is preferred to use the VISA functions to control the serial port. They have nice error cluster inputs and outputs for one thing. They also use the VISA Resource Name controls to identify the port being used. Your VI is hardwired to use port 0, regardless of what the OS maps that to.

 

The use of stacked sequence structures is strongly discouraged. Use a state machine.

 

Similarly, use wires in place of the local variables. With the state machine architecture it is easy to wire data from one state to another via shift registers.

 

It appears that you are writing a carriage return with each message sent. This usually suggests that the external device is likely to terminate its replies with a carriage return also. If it does, then you should enable termination characters at initialization and remove Bytes at Port before the Read.

 

Lynn

Message 2 of 3
(2,727 Views)

Hello,

 

Thank you for your answer.

Anyway problem is solved after installing VISA drivers.

 

BR

0 Kudos
Message 3 of 3
(2,519 Views)