Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Communication Problems

I'm having difficulty communicating with my serial device (sun tracker) using VISA. With hyperterminal, i can control the device fine. With VISA nothing happens. I tried analysing the differences in the communication attributes using Portmon.

Under Serial Set Handflow,
Hyperterminal has Shake:80000001 Replace:80000040 XonLimit:80 XoffLimit: 200
while VISA has Shake: 1 Replace:40 XonLimit:64 XoffLimit: 250

Also, under Serial Set Timeouts
Hyperterminal has RI:10 RM:0 RC:0 WM:0 WC:5000
while VISA has RI:-1 RM:0 RC:0 WM:0 WC:250

Under Serial Set Queue Size
Hyperterminal has InSize:8192 OutSize:8192
while VISA has InSize:640 OutSize:640

other attributes like baud rate, parity etc are the same.

Will altering the VISA attribu
tes solve the problem? if yes, please tell me how. If no, please give me some other hints.

PS: the device requires the characters "&*" in front of every command. in hyperterminal, each character is written individually ie length 1. in visa, the characters are written as a whole ie e.g. length 11

many many thanks
0 Kudos
Message 1 of 7
(5,342 Views)
Are you able to see the actual data transmitted with portmon? You may want to fire up NI Spy to confirm that the data is being transmitted properly. Also check that termination isn't on.
0 Kudos
Message 2 of 7
(5,342 Views)
Thanks Chris! ive tried NI Spy.
Data is transmitted via VISA. But i keep getting error msg re: VI_ATTR_ASRL_WIRE_MODE
after i checked VISA help, it seems that VI_ATTR_ASRL_WIRE_MODE is for RS485. im confused.
Termination? Do you mean to disable termination character? Thanks man, ive been at this for some time now.
0 Kudos
Message 3 of 7
(5,342 Views)
You're getting an error message about wire modes? This is indeed a RS-485-only mode - can you send me your code?
0 Kudos
Message 4 of 7
(5,342 Views)
I'm a real novice and have not written any code yet. I'm still stuck at trying to use VISA to communicate with device. I'm guessing that because of the settable attribute conflicts, I cannot control the device. I also chanced on a message in the discussion forums that hint at a termination character and "\" codes. Could you please shed some light on this?

Will sending my NI Spy log file help?
Unforunately I cannot capture anything from hyperterminal using NI Spy. But I can send a log file from Portmon if that might help.

Many thanks
0 Kudos
Message 5 of 7
(5,342 Views)
We could look at logs, but that may be the long way to go about solving your problem.

The sun tracker has certain settings (baudrate, etc.) as well as some sort of command syntax (ASCII strings most likely). You can usually type these by hand using hyperterm, but it sounds like you wish to make a LabVIEW app that controls the device.

I would start using the simple communication example - it doesn't touch the RS485 controls and just spits out the commands you want to send. This is where the I/O assisant comes in handy - you can use it to write your communication code.

We recently released (after LV7) a new set of serial examples that should be a lot easier to use. Do you have these?
0 Kudos
Message 6 of 7
(5,342 Views)
Exactly right! it was a termination character or rather characters issue... thanks for your help.
0 Kudos
Message 7 of 7
(5,341 Views)