You do not state what operating system you are using. Â I recently had a VEE 5.0 program that ran on UNIX and controlled a set of precision motor drivers using a serial port. Â Everything worked great. Â We typically sent command strings just the way you are doing.
Then we migrated to a PC bases system. Â It didn't seem to matter much if it was Win2K or XP. Â In either case, this approach did not work. Â Every now and then, I would lose a character on a command. Â The device being commanded would fail to execute the command (that it didn't get) and the software would either hang up waiting for something to happen that wasn't going to happen, or I would be trying to get a reply from a serial device that was still in receive mode waiting for a command. Â This can cause a timeout error.
The fix for us was to send out the serial commands as a series of bytes instead of a single string. Â You have to include the carriage return or newline character as a byte at the end of the command string. Â Apparently, XP likes to assert control of the IO ports at the wrong time and kills part of the command string. Â And it appears to be random! Â Check the VEE archives and you will see more about this. Â Our solution was based upon the info we found in previous posts. Â
So, for your application, you will need to send out the ASCII values for
Reading a string was never a problem for us. Â Also, if your instrument or controller echoes back the characters it receives, you can do an on the fly error check as well.
Business Line Ultrasound
Philips Medical Systems
3000 Minuteman Road
Andover, MA 01810
"Pimentel, Tim" <Tim.Pimentel@adc.com>
08/03/2006 05:31 PM
Please respond to
"Pimentel, Tim" <Tim.Pimentel@adc.com>
[vrf] Timeout on RS232 com port using Direct I/O
I am using Vee 5.01 and am having trouble with I/O or timeout occurred errors (Error number: 811) in Direct I/Os for an RS232 com port. The serial device itself (IES 8-Port RF Switch) requires;
Bits per second: 9600
Data bits: 8
Stop bits: 1
Flow Control: None
with 50 ms minimum/100 ms preferred between successive switching commands.
I have set up my Switch Serial (@1) Direct I/O like this;
Â Â Timeout (sec): 5
Â Â Live Mode: On
Â Â Byte Ordering: MSB
Â Â Baud Rate: 9600
Â Â Character Size: 8
Â Â Stop Bits: 1
Â Â Parity: None
Â Â Handshake: None
Â Â Receive Buffer Size: 4096
Direct I/O tab
Â Â Read Terminator: "
Â Â Write
Â Â Â EOL Sequence: "
Â Â Â Multi-Field as : Data Only
Â Â Â Array Separator: ","
Â Â Â Array Format: Linear
Plug&play Driver tab
Â Â Plug&play Driver Name: Unknown
Â Â Parameters to init() call
Â Â Â Address (e.g. GPIB-VXIO::12::INSTR): ASRL0::INSTR
Â Â Â Perform Identification Query (checked)
Â Â Â Perform Reset (checked)
Panel Driver tab
Â Â ID Filename: (blank)
Â Â Sub Address: (blank)
Â Â Error Checking: On
Â Â Incremental Mode: On
An example of the commands in the Switch Serial (@1) Direct I/O for switching to 1N and 1F ports:
WRITE TEXT "RFS1N" EOL
WRITE TEST "RFM1F" EOL
I have 16 User Functions that use similar Direct I/Os for switching between the various port combinations on the IES switch, the command syntax in lines 1 and 3 changing accordingly.
The error appears to occur randomly in time and randomly among the 16 User Functions, but always in line three of erring the Direct I/O.
I have tried increasing/decreasing the WAIT INTERVAL to no avail. I have tried to slow down the PCs serial port through SettingsDevice Manager to no avail. If the IES Switch requires no Flow Control and Direct I/O is set up for
no Handshake, how/why does Vee detect a timeout? I would think Vee would send data out over the RS232 and keep going, not caring if the serial device is responding. Any help or ideas?
Senior Lab Tech
7600 East Orchard Road
Greenwood Village, CO 80111
You are currently subscribed to vrf as: firstname.lastname@example.org
To subscribe please send an email to: "email@example.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "firstname.lastname@example.org".
To send messages to this mailing list, email "email@example.com".
If you need help with the mailing list send a message to
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
--- To subscribe please send an email to: "firstname.lastname@example.org" with the word subscribe in the message body. To unsubscribe send a blank email to "email@example.com". To send messages to this mailing list, email "firstname.lastname@example.org". If you need help with the mailing list send a message to "email@example.com". Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".