ddl Posted April 30, 2012 Posted April 30, 2012 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 ?
AzeoTech Posted April 30, 2012 Posted April 30, 2012 Is this a serial or Ethernet connection? What else are you doing to initialize your device?
ddl Posted May 1, 2012 Author Posted May 1, 2012 This is serial connection (using serial to USB converter). I tried to stop and begin the sequence but it would not work
ddl Posted May 1, 2012 Author Posted May 1, 2012 Also, I forgot to mention from previous reply. The MCU is power by the power from the USB. If I unplug the USB cable, it also power down the MCU
AzeoTech Posted May 1, 2012 Posted May 1, 2012 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...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.