Discussion:
Losing reply message when using NI RS232 card
(too old to reply)
mnaylor
2008-08-08 18:10:13 UTC
Permalink
I recently installed the PCI-8432/2 card hoping that it would increase reliability of a system I am working on -- RS232 communications had been working fine, but a previous card I had been using had reliability issues.  After installing this NI card, I am no longer receiving replys to messages that I send out (software is unchanged from previous state that has been working for a long period of time).  I am developing under cygwin using g++ compiler on an XP embedded system.  The port is being opened with the following parameters:       rrPort_ = open(rrDevice_,O_RDWR|O_NOCTTY|O_NDELAY,0666);   struct termios t_s;   tcgetattr(rrPort_,&t_s);   t_s.c_iflag = 0;   t_s.c_oflag = 0;   t_s.c_lflag = 0;   t_s.c_cc[VMIN] = 0;   t_s.c_cc[VTIME] = 1;   t_s.c_cflag &= ~(CSIZE|PARENB);   t_s.c_cflag |= CS8;and then setting the baud rate appropriately applying parameter changes...With these parameters, the write() calls work fine -- the device I am communicating with repsonds correctly, but my read() calls (that work fine with other RS232 ports not on the NI card) receive no information.  I've tried two different NI cards.  Also, as another test I put an RS232 break-out box in the middle of the line connecting the two devices which shows LEDs for each pin... it appears that the voltages when running with the NI card are significantly less than with other RS232 ports -- the LEDs are much dimmer.  I would appreciate any ideas or tips that might help me solve this problem...Thanks!
Song_M
2008-08-11 21:40:10 UTC
Permalink
Hey mnaylor! You need the NI-Serial drivers to be able to use the PCI-8432 card.  You can download it here:http://joule.ni.com/nidu/cds/view/p/id/1069/lang/en
Song_M
2008-08-12 18:10:11 UTC
Permalink
Hey mnaylor! I actually reread your post and realized that the card is working correctly.    The 232 standard allows for a wide range of voltages, NI card output voltage that is compliant with 232 specifications, but at the low end due to emphasis on power consumption.  Can we verify that the #1 the card is outputting data.#2 the instrument is receiving data.#3 the instrument is responding with data.#4 why the NI card is not picking up data.Thank you!
mnaylor
2008-08-12 18:40:11 UTC
Permalink
Thanks for the response: I can verify #1, #2 and #3.  My instrument receives the original message that is sent from the NI card and from monitoring serial output on the device I can see that the response is being transmitted. (also, by changing to the motherboard board serial port I receive the entire response).  I have no clue why with only the NI card I do not get the response.  I tried 2 different cards in 3 different computers and have seen this behavior in all cases.  Also, if I just connect the NI port with another serial port (either the other port on the NI card or any other port) directly with a null modem cable and open the ports in hyperterminal I can manually input data and see all data transmitted and received.  I do have the 340 drivers installed.Thanks,Mike
Song_M
2008-08-13 15:10:18 UTC
Permalink
Hey mnaylor, what software are you using on your end to read data on the serial bus on the NI Serial card.  If you are doing it programatically, you should make sure to put a wait or delay between when you do your write and your read.  Otherwise, the card might be reading too fast right after it wrote so it is capturing the data too early.  Tell me if this might be applicable!
Loading...