I am usually able to sort out problems with the help of this Forum which is the most amazing resource available for LiveCode. However, time and lack of knowledge about serial communication has motivated me to ask for help.
I have confirmed that LiveCode and the port share the same "9600,N,8,1" settings.
I have set up a simple button script to test sending a single "A" character to a Windows 10 PC COM port (COM5 to be exact). Here is the script:
Code: Select all
on mouseUp
put empty into fld 1
set the serialControlString to "BAUD=9600, PARITY=N, DATA=8, STOP=1"
open driver "COM5:" for write
put the result into fld 1
write (numToChar(65) & return) to driver "COM5:"
close driver "COM5:"
end mouseUp
I'm using a great app called "Serial Port Monitor" to look at what's happening. See the the first 2 lines of the table it builds from pressing the "Send" button below (I can't send a screenshot because I guess I'm too new?):
164 12/08/2024 10:39:33 IRP_MJ_CREATE DOWN LiveCode(full path shown) COM5
165 12/08/2024 10:39:33 IRP_MJ_CREATE UP STATUS_SUCCESS LiveCode(full path shown) COM5
Why doesn't LiveCode handle this basic serial communication task? Perhaps the venerable "open driver" command cannot negotiate with the UART in the PC to access the USB bus for serial data?
Thanks so much for any suggestions. When will I be able to attach images?