I reopen another conversation to be more clear. I am making a program for my RS232 device. The program involves searching for devices and switching commands via buttons.
My main window is this:
When I click on Search the various addresses appear on the TextArea. When one appears, I click on SEND and another window opens. From there I send ON / OFF commands to switch LEDs on the device. This works, but I have a problem. When I click ON / OFF the device replies with a “from” value and I have to display it on window2. Now this shows it to me on window1, which I don’t want. I attach the problem here:
Then:
On window1 I just want the addresses and in window2 the da. How can I do it, please help me.
you need something like this?
answer=“da”
select case answer
case “da”
Self.TextFieldActuator2.Text=answer
Self.W2.TextArea.Text = Self.W2.TextArea.Text + answer
where W2 is a property in Window1 and contain your other window.
or you make a protocol and send from window 2 to device
f2,ch1,on
and return from device
f1,actuator1,da
f2,ch1,da
Maybe they are almost there, there is a command to say send command1 wait until the command has been received send command2. I tried a delay between the two, but I can’t send command2.
the tricky part is to fiddle the in and out from serial data into a structure.
try to send a instruction with a begin and end keyword and a return as confirmation.
you could use a command list and a timer to run the dialog asynchronous.