| Serial Port [message #41937] |
Tue, 30 November 2004 07:05 |
patrick.dillmann
Messages: 5 Registered: November 2004
|
Junior Member |
|
|
Hi,
I have a problem if I try to read a serial port on a Win 2000 PC. If I
only send a message to a device everything works fine. But when I use
the following Code to get an answer IDL hangs up:
val=bytarr(34)
port='COM1:'
get_lun, u
openu, u, port
text = 'DATA?'+string(13B)
writeu, u, text
readu,u,val
close, u
free_lun, u
Due to the fact that this code works as expected even for getting an
answer if I first start and close the Hyper Terminal for this port, I
believe that I must send some port settings (e.g bits per second,..)
before sending my code.
If this is the case, how can I initialize a serial port with IDL? Are
there other possibilities to communicate with a device via a serial
port?
Thanks,
Patrick
|
|
|
|