02-23-2009 06:14 PM
Solved! Go to Solution.
02-24-2009 01:41 AM
02-24-2009 11:02 AM
Thanks Roberto.
That is what I am looking for. I searched the NI website but did not know it was installed on my PC. The comms work fine. Now what I need to do is select one of 32 COM ports and Monitor the RS232 traffic and/or manually test the the COM port with Tx and Rx text. Do you have any canned code?
02-24-2009 11:13 AM
Well, I use no special code for this: simply shorting pins 2 and 3 of the com port together makes every message sent to be received on the same port, so you can initially test you app with some ComWrt and the corresponding ComRd.
...or am I misunderstanding your question?
02-24-2009 12:33 PM
The comms work fine with shorting the pins for testing.
What I need now is:
- to display the RS232 traffic on a emulation of a DOS screen (80x24 characters)
- Select one of 32 channels of RS232 data, then I only need one text window
- Tx data red, Rx data black
- Manually enter Tx data and receive Rx data for testing
I assumea a lot of this will be done with Tx data buffers and Rx data buffers.
Have you seen an 80x24 character DOS type screen by chance?
I have to update a legacy system and add some automation to it.
02-24-2009 05:06 PM - edited 02-24-2009 05:11 PM
You're right: input and output buffers will be used for serial I/O. Regarding mimicing a DOS screen, I'm not aware of a mode to obtain it if you intend to have the whole screen confined to that region (BTW I have seen lots of DOS screens! My career started in DOS world and sometimes I am still using it for fast testing of communications with external devices ). You will need to develop your own terminal-like application, possibly using a textbox as operator input area and a listbox as the output (the only native control capable of displaying text in different colors, well... not considering here tables, which I consider oversized for such a task). On every commit event on the textbox (the user pressing Enter after entering some text) you will need to:
Regarding the selection of the COM port, it's not clear to me wether you want to have a list of available ports or simply let the user choose a value from 1 to 32 and open the corresponding port. In the first case the dll published by msaxon in this thread maybe of some help to you.
02-24-2009 05:33 PM
Thanks Roberto.
This is a great starting point.
As for the COM ports there are two 16 port USB serial servers for a total of 32 COM ports. Depending on which server is pluged-in (discovered) first will change the COM mapping on the PC not to mention if there are any other USB serial devices connected to the PC. The plan is to be able to select any of the Serial Server COM ports only and they will be labeled in the LabWindows/CVI UI for example:
TA232 =Serial Server Port 1 = PC COM4
TB232 =Serial Server Port 2 = PC COM5
TC232 =Serial Server Port 3 = PC COM6
TD232 =Serial Server Port 4 = PC COM7
.
.
.
The Serial Server port mappings will not change but the PC COMx mapping could change depending on which order the USB cables are discovered. In the LabWindows/CVI UI I want to name the buttons that select the COMx ports as TA232 etc.
I don't know if this will be possible?
02-25-2009 12:49 AM
You could have a button "Scan for COM ports..." that scans the available com ports in the system and populates a ring control with only active ports: let the user select the appropriate one and press a "Start communications" button to actually open the selected port.
Regarding the port scan, I remember to have read in the forum several solutions to this task:
Make a search in the forum for these subjects.
02-26-2009 02:41 PM
Is there a way to configure the serial com port receive to act like a received character interrupt routine?
I want it to automatically immediately stuff a received character into the rx_buff and also a display text box so I can see the data as it arrives.
The Help file did not mention this? A programmers reference would be nice but I don't think it exists.
02-26-2009 03:39 PM