How to resume Rx after disconnect and reconnect serial cable


ddl

Recommended Posts

I used a simple script below to receive data from a UART of a microcontroller (MCU)

while(1)
try
private string Received_Data = device.MOTOR.readUntil(10)
Received_Data = parse(Received_Data, -1, ",")

P1_0.Addvalue(strToDouble(Received_Data[0]))
P1_1.AddValue(strToDouble(Received_Data[1]))

catch()
? strLastError
delay(0.5)
endcatch
delay(0.05)
endwhile[/CODE]

My file.ctl will receive data from the MCU if I run the MCU first, then DAQfactory.

While DAQfactory is receiving data from the MCU, if I disconect or power down the MCU and then reconnect (or power up) the MCU. DAQFactory would not receiving data from the MCU unless I close DAQFactory and reopen it.

Is there any other method to resume receiving data without closing DAQFactory ?

Link to comment
Share on other sites

With USB-Serial converters, unplugging the converter will kill the serial port within windows. To reestablish comms after reconnect you have to do:

device.myDevice.initComm()

Note, this is yet another reason I don't like USB-Serial converters and prefer Ethernet-Serial converters...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.