View Full Version : Get the message in a variable

February 3rd, 2008, 02:48 AM
I would like to use Girder 3 to build a driver for my touchscreen.
(I did never use Girder until now).
I use the serial plugin and I can get the messages sent by the touchscreen.
When the touchscreen is activated, it sends messages "C3 ab cd xy zt" where "ab cd" is the X position of the touch and "xy zt" is the Y position of the touch.When the touch is released, it sends a message "C7 00 00 00 00".
I can imagine what has to be done but :
- my first problem is to get the message "C3 ab cd xy zt" in a variable,
- my second problem is to find the tools to extract the right characters from the whol chain.
Is a plugin required ?
Could you help me please ?

Rob H
February 3rd, 2008, 05:21 AM
You'll need the serial plugin - not sure if it comes with Girder 3.3 (it's been a very long time since I used it) or whether it's a separate download. It would be a lot more straightforward in Girder 4 or 5

February 3rd, 2008, 06:09 AM
Yes, I have the serial plugin.
It works fine and I can visualize the touchcreen message in Girder (in the display window).
What I can't do is to put it in a variable...

Rob H
February 3rd, 2008, 07:06 AM
I really can't remember how the G3 serial plugin works (I don't even have G3 installed any more) - the documentation for the serial plugin should provide a hint as to where it puts the data, e.g. in pld1?

June 6th, 2008, 06:11 AM
The content of the eventstring is stored automatically into a variable named "SerialValue", but you don't see it in the variables window.
Assign it to a variable with different name within a script like this:
MyVariable = SerialValue
The scripting upon reception can be activated in the serial plugin configuration.
After reception the string appears in the variables window now and can be used due to your needs.