From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Hardware Developers Community - NI sbRIO & SOM

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Serial on ni-9651

Hi,

I am trying to use the built in rs 232 com ports on the SOM demo board to communicate with an instrument, I can write out values fine, but i cant get the comport to read values back. I tried to look around a bit and found something about Visa serial 14 for RT (see this page http://digital.ni.com/public.nsf/allkb/10C6C0FBB8E7BD4486257850006CE8FF). I do not have this installed (see image of my installed software below), and cant seem to install it. I am not sure if this is an issue since I can write fine i think mabey the drivers are in NI-visa 14?

I have tried using both COM 1 and 2 (ASRL1::INSTR and ASRL2::INSTR) with the same results. The read function just times out after a while.

Assuming this is not a a driver issue is there anything else that is likely at fault? something different about using visa serial on labview linux RT?

software installed.png

Quick edit: I have used the this instrument and visa communication on windows (not RT) with no issues for a while.

Regards

Mas

0 Kudos
Message 1 of 5
(5,179 Views)

Hi Mas,

When you say you can write out just fine, can you verify the bytes written are being toggled at the RS232 connector pins?  Do you see your device responding/acting based on the commands you are writing to it?

SERIAL1 should always work for basic serial (TX/RX only), but SERIAL2 and the full serial support on SERIAL1 (CTS, RTS, etc.) will only work if they are enabled in the socketed CLIP and compiled into a running FPGA VI.

Setting up the appropriate FPGA VI is outlined in the printed quick start guide included in the Dev Kit box.  Electronic version of that document is here:

http://digital.ni.com/manuals.nsf/websearch/F49D72877A8AB63B86257D9300784A92

In addition to ensuring the device is configured with an appropriate FPGA VI/bitfile, the other common mistake with serial is ensuring the baud rate, data bits, stop bits, and parity are matched to what your device is expecting.  I'm sure you have already checked all those things, but I find it useful to doulbe check even the simplest things when a simple VI doesn't appear to work.

Regards,

spex

Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 2 of 5
(4,574 Views)

Hi,

I have not checked the bytes at the pin level, but I can see the instrument responding yes, (its a laser, and i can turn it on and off). When i communicate with the laser from windows the laser turns on and responds with an answer, when i turn it on from the SOM it turns on, but I never get the response.

The reason i found this was because when i initiate contact with the laser i use the responce to verify that it is working, and since i got no responce at first i assumed I could not write to the laser, but after i while i found that just the answer was missing.

I think my CLIP setup is correct, writing to the laser works from both serial1 and 2.

I also think the baud rate and such is correct since I am using the same as befor which still works from windows. ( I have also rechecked these values trying to get this to work).

0 Kudos
Message 3 of 5
(4,574 Views)

Hi again,

Just to inform anyone looking into similar issues. The fault was of course, not with the hardware nor the OS. The error was in a non-standard made RS 232 9 pin connector, Tx line was on pin 1. Everything now works as expected with a new connector.

Thanks for the help.

0 Kudos
Message 4 of 5
(4,574 Views)

Mrmas,

I find that serial always extracts its pound of flesh....

Thanks for posting the solution. It's a indication of the complexity of developing these systems...so many details.

Regards, Happy Embedded Wireworking

Jack Hamilton

0 Kudos
Message 5 of 5
(4,574 Views)