MagicBoto,
Your problem can be solved.
But you should reconsider your process design. It might be much easier
to transfer your data using networking. Establish a network connection
between the two PCs and a share on one of the hard disks. Than, when
your butten is pressed, just write the data to that share. On the
readers site, check the existens of the data file and read it when its
there.
If your serial solution is neede by some other reasons...
The effort depends on what you plan to create. If you just want a
plain solution to your existing problem, this is easily don. Assuming
that your connection is established with blootooth and there are just
the two communication partners 'connected', you should do the following:
On senders site:
* VISA configure serial port(Ressorce=Port, baudrate etc.) as used with your virtual port from the bluetooth adapter
* Your code
* Case button_pressed do
* Data_string =: Flatten_to_String(your data)
This 'casts' your data to a flat string called 'data string'
* Sendstring =: concatenate(Flatten_to_String(length(Data_string)+4) & Datastring)
This brings the length of the wole sendstring
to its front in order to inform the receiver of the amount of data to
expect
* VISA_Write(Sendstring)
This sends out your data
* Your code
* VISA_Close
On receivers site:
* VISA configure serial port(Ressorce=Port, baudrate etc.) as used with your virtual port from the bluetooth adapter
* Your code
* While not <Stop> do
(create a buffer and a Readsize variable as shift
registers on the While loop and wire an empty string from outside the
loop to the left register of buffer and a zero to Readsize)
* If VISA_Bytes_at_serial_Port > 0 than
* Append(buffer, VISA_Read(Byte_Count=VISA_Bytes_at_serial_Port)
* If size(buffer)>>=4 AND
Raedsize=0 than Readsize=unflatten(Substring(buffer, from0, 4)_type I32
* If size(buffer)>=Readsize than
* Data=unflatten(Substring(buffer, from4, rest)_yourDataType
Your
Data might be sent to a processing parallel process using a queue or
something. In this example I just put it into 'Data'
Data will be overwritten when the next data is received!
* Buffer=substring(buffer, from_Readsize, rest)
* Readsize=0
This prepares the receiver for the next chunk of data
EndIf
Else Wait 5ms
IfEnd
WhileEnd
* Your code
* VISA_Close
HTH and
Greetings from Germany!<br>-- <br>Uwe