LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I intend to project a tool to perform the test of the serial port

because of that i have some questions to do the first is when i open the port what happens really(is just a allocation of memory for the pipe to be initiated) the second when i write to serial port i am writing on buffer only(it be the data won't goes to the device attached to serial port?).the third at LabwindowsCvi how can i change the color of a control based in a event(what is the function to change the color of a control?).my e-mail is stanley.leite@nokia.com
0 Kudos
Message 1 of 5
(3,442 Views)
Op opening a serial port you initialise two data buffers for incomming and outgoing traffick. Under windows you don not have direct access to the hardware on the serial port and the flow between the buffers and the serial port drivers is controlled by windows.

When you write data to a serial port you write data to the buffer and the software buffer feeds that to the hardware buffers and the serial device attached to the port will clock the data from the buffer, i.e. if hardwar handshaking is enabled it relies on the hardware lines handshaking properly and data is send in a controlled fashion between devices based on the configured baudrate of the port.

The same happens on the receiving side. The hardware clock data in at the defined baudrate and keeps th
at in the serial buffer untill it is read by you in a soft routine. This whole process relies on the hardware handshaking used in your application. Read more on this by doing a web search on "fundamentals of serial communication".

To set control colors use:

SetCtrlAttribute (handle, ControlID, ATTR_TEXT_COLOR, VAL_RED);
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
Message 2 of 5
(3,442 Views)
Hi,

One thing to add here, when you use the CVI functions to access the serial port, you are calling the driver that Windows has for that serial port. If you want to have full control of what is happening in the serial port, you can use the inp(,,) and outp(,,) low lever port access to control the registers on the UART, this way you set every parameter on the port and avoid any problems related to the driver. This will not be easy, but you are in charge of every operation on the serial port.

Just my 2 cents.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 5
(3,442 Views)
thanks for the answer.it helped me a lot
0 Kudos
Message 4 of 5
(3,442 Views)
thanks foir the answer.with it i could almost complete my project....
0 Kudos
Message 5 of 5
(3,442 Views)