LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication Problem

ok i'm tring to communicate using the serial port to a device when an A1 hex is sent it turns on and led and an A0 hex turns it off.

i have tried using several different methods,most of the examples here, and none are working.

i have logged the seriel port and the data is there according to the logger.

i can use vb to to turn the led on and off.

Public Sub LedOn()
Writeled ("A1")
Call DelaySeconds(0.25)
End Sub

any idea's as to why it won't communicate??
0 Kudos
Message 1 of 6
(2,984 Views)
Are you using VISA calls or the older traditional Serial interface?

rjmiller
0 Kudos
Message 2 of 6
(2,984 Views)
yes i am using visa calls
0 Kudos
Message 3 of 6
(2,984 Views)
OK, so on your front panel, you have the VISA handle and internally a call to VISA Open which the output handle is piped to the VISA write (for example).

On the front panel can you see ASRL:: anything?

If not, can you run VISA interactivly without LabView - should be under the Programs->National->VISA->

You can also run MAX to see the COM ports as welll.

Are they present?

rjmiller
0 Kudos
Message 4 of 6
(2,984 Views)
If you can see the ports in VISA, try checking the termination character in the VISA initialisation. If the instrument you're communicating with doesn't expect a termination character, this might be the reason for the problem.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 6
(2,984 Views)
You mentioned that the instrument requires hex. If you need to send 0xA1, then right click on your string control/indicator and select hex display, then type in A1. If you are in normal display, then you are sending an ASCII 'A' and '1', which is 0x4131 in hex.
0 Kudos
Message 6 of 6
(2,984 Views)