Skip to main content

If you have a device that talks serially to a Galil Serial port, this code will mirror the incoming byte stream to an outgoing Ethernet Handle.

Lower baud rates may be necessary depending on the volume of data being transmitted.


CI2,1;'configure communication interrupts for DMC-21x3
CFB;'send unsolicited messages out of the B handle -- ensure that this is an
'unconnected handle or a unimportant one. Messages (error codes) sent here
'should be ignored
'
CW1;'CW2 for non-Galil receiving software, CW1 for Galil, example, g.message()
'
#LOOP;'dummy loop running, #COMINT interrupts here
JP#LOOP
'
'
REM when character comes in on RS232 port
#COMINT
MGP1CH{S1}{N}{EA}
REM Note the {EA}. This sends the character to the desired handle.
REM Every 80 characters without a carriage return will generate a ?
REM from the controller. Due to the CFB above, this is ignored.
REM The ? is generated because 80 characters is the standard command
REM line max. It doesn't matter here with serial port in CI mode.
REM Note, Carriage returns are not mirrored, so use a different delimeter
REM
REM to optimize packet traffic, concatenate chars (in array)
REM and send periodically in one MG
EN1,1 ;'return from COMINT