Asked
— Edited

I have a device that is sending information in on a serial port. I want to evaluate the incoming string then if it = a specific value to set a system variable. Something like this:
If the serial input = "MOTION" then system variable Motion = "1"
Thanks.
You need to use one of the 3 UART ports on the ezb4.... In ARC there is an example on how to use the UART port for reading data...
I have the port connected and I can see the incoming input. I just need to read it and evaluate it. I have been looking for that info, but it eludes me.
In the Script Syntax examples installed with ARC, open the UART Peripheral example project. It shows how to read UART data into a variable. (add a Variable Watcher object to get a better view of how you would use the data).
Alan
My input is not from an EZ-Board it is from an old project that I'm trying to integrate it from. My input is not from an EZ-Board it is from an old project that I'm trying to integrate it from. The old project puts info in to the serial from a USB. I can get ARC to see the port in serial terminal. What I found in the Talks about getting it from the EZ-B4. But I need to get it from the computers serial on a USB port. If this makes any senses.
If I understand, you have something connected to the comm port of your PC and want to read the data into a variable in ARC rather than connecting to the UART port on the EZ-B?
There are no script commands to support that at this time.
Do you know how to program in .NET? If so, you can write a simple serial reader that uses the EZ-B SDK to write data to an EZ-B variable.
Other options are (again, through some coding) writing to a file and using the readfile functions, writing to a web page and using the http functions, enabling the TCP terminal and sending from an app via TCP/IP socket (telnet) to the script interface, probably more I am not thinking of, but all would involve some external code.
What was the original application? do you have the source code, or documentation of what it can do with the data?
Alan
Well, hold on a second. There is no specific Read command for PC serial.
Buttttttttttttttttttt (that's a big BUT)
The GetControlValue script option might, maybe, possibly, (don't hold your breath) work. This at least ran for me, but I don't have anything to read from a serial port on my PC, so, I'm not sure. If you look up GetControlValue in the script manual, in the example you'll see "pause" is the condition it was looking for...how that would work for what is incoming in the serial terminal I am again not sure.
Interesting. I totally missed GetControlValue. I wonder if I can find any serial devices around the house. Used to have some, but I think I traded them all for robot parts or threw them away (hmm... do any of my PC's even still have a serial port.. I am sure one of them does).
That might just work.
Alan
Never mind, that does not work. In order for it to work, it too must include script commands that are recognized. "Pause" appears to be hard coded to work with anything, even "Serial Terminal" which has no GetControlValue parameters.
I would like having this feature myself. But, rather than waiting on it to be added (maybe) to ARC, one option is to use an external application custom made to pass the value onto ARC. OR, if your device has an option to send data via UDP....like with an IP address, ARC does have a scripted function for that.
If you are reading motion...is that from a motion sensor? Perhaps an alarm or security system?