07-09-2015 10:38 AM
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?
Quick edit: I have used the this instrument and visa communication on windows (not RT) with no issues for a while.
Regards
Mas
07-10-2015 08:03 AM
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
07-10-2015 08:15 AM
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).
07-14-2015 03:14 AM
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.
07-14-2015 11:48 AM
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