Listening for Incoming MLServeCmds via Serial

A plugin that allows for end user development of multiple RS232 device control systems.
User avatar
VinceC
Member
Member
Posts: 77
Joined: Fri Oct 08, 2004 8:25 am
Contact:

Listening for Incoming MLServeCmds via Serial

Postby VinceC » Mon Apr 28, 2008 11:44 am

Hey Mainlobby folks,

I have a pretty simple usage question on the MLGenericDevice plugin.

I am able to send out serial commands but I am unsure how to listen for them. I will have another control system hooked up to the serial port of the mainlobby computer. The easiest thing to do would be to make a serial to MLServCmd bridge.

Using this method the serial commands on my control system (RTI in this case) can simply send the actual command via ascii over the serial port of mlserver.
ex: MLServeCmd.MLUSBIR6|SendIR~Samsung1~PON <CR>

mainobby would listen for this and execute whatever commands were sent to it.

I think this is possible with some wildcards and maybe some VBScripting. Any ideas on how to implement it?

Thanks,
-Vince

User avatar
VinceC
Member
Member
Posts: 77
Joined: Fri Oct 08, 2004 8:25 am
Contact:

Postby VinceC » Wed Apr 30, 2008 12:33 pm

OK, I got it working through some trial and error. I used a baud rate of 38400 8-N-1 on both ends, and i put in a .4 second delay between serial repeats coming from my control system.

I made a new basic device with the settings above. The command terminator i used is 13.
13 is a carriage return ie: \r %0D \x0d, however you have to use it...

After you have a device created and have set it to a COM port:

Goto commands -> Device Response tab
Create new command ex:'MLSerialBridge'
Device response: <<VAR>>
Use Script:

Code: Select all

Function ReturnValue()
Output.AddItem "<<VAR>>"
ReturnValue = ""
End Function



press ok, restart mlserver, then goto the MLGenericDevice -> Events tab and test your serial communication.

The commands you send should be full MLServeCmd's with a carriage return on the end.


Return to “MLGenericDevice”

Who is online

Users browsing this forum: No registered users and 1 guest