Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use "Unsolicited Messages" tool to communicate between ppmac and IDE?
#1
Hello there,

I want to send strings to IDE and get strings from it. Athough sys.cdata can be used to achieve that, but, I think, the more convenient way is to use "Unsolicited Messages" tool in IDE.

I find such built-in Send()/GetSend() functions may help, as shown below. But it seems that GetSend() did not work well because the returned value is always 0, which represents how many characters ppmac has received from software serial port.

Anyone can help?


Hikor


Attached Files Image(s)
   
Reply
#2
If you include the send command (but not the getsend command), can you read your message from the unsolicited messages window? It is available under the tools menu.

You may want to send a message from somewhere else so that this code can receive it to test the GetSend command. Try the following in the terminal.
Code:
cx send0,"Hello, World!"
Reply
#3
(10-23-2020, 12:00 PM)Eric Hotchkiss Wrote: If you include the send command (but not the getsend command), can you read your message from the unsolicited messages window? It is available under the tools menu.

You may want to send a message from somewhere else so that this code can receive it to test the GetSend command. Try the following in the terminal.
Code:
cx send0,"Hello, World!"

Hi Eric,

Yes, in my code, function Send() works well and the "unsolicited message" tool of the IDE always receives what is Send() from ppmac.

It is the function GetSend() taht not work well and I can not receive, in my code, what is sent from IDE/serial port 0, as I press "Send" button in "unsolicited mesage" tool.

The "cx send0, "command direction is from ppmac to IDE/serial port 0, which is not what I want.
Reply
#4
This issue was resolved over email.

An unsolicited messaged can only be received one time. If the unsolicited messages window receives it, then C code will not be able to see it.

By default the unsolicited messages window receives messages on buffer0, so if you wish to use if to send messages change it to buffer 1 with the pulldown in the top left of the window (see attachment) and change your GetSend(0,x) command to use buffer 1 GetSend(1,x).

It If you right click the window and go to "Properties -> Control -> General" you can enable receiving of various buffers.


Attached Files Image(s)
   
Reply
#5
Thank you Eric.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)