CHANNEL_WRITE

CHANNEL_WRITE

How do I write axis variables or VR integer values into the channel?
Like this? CHANNEL_WRITE(tcpserver_channel, " " + TIME$ + " " + CHR(VR(0)) + " " + CHR(VR(1)) )

Answer:
No, the CHANNEL_WRITE needs to have a string as the data to write.

CHANNEL_WRITE(tcpserver_channel, " " + TIME$ + " " + STR(VR(0), 0) + " " + STR(ENCODER AXIS(0)))

STR(VR(0), 0) means the value of VR(0) with 0 characters after the decimal point.
    • Related Articles

    • Serial ports on PC-MCAT for Motion Coordinator Channels

      The PC-MCAT API brings channels 1 and 2 out into the API, but does not map them to anything.  The attached little program is an example which will do that for you. It is a 7z folder encrypted with password abc123. A USB to RS232 converter will be ...
    • AN-312 Ethernet UDP connection

      UDP is a connectionless transport protocol designed to operate over IP. Typical applications in Industrial Control includes fast data transfer from cameras and cyclic “Process Data” from PLCs. UDP does not guarantee the delivery of packets but ...
    • Wiring for RS485

      The Motion Coordinator has a 4-wire RS422 port.  This can be set as a 2-wire RS485 port by wiring the Tx and Rx together. MC664 is shown.  All Motion Coordinators have the same port pin configuration. For some protocols it will be necessary to set up ...
    • RS485 communication with a battery-pack

      There isn't an automatic control of the 2 wire "echo" when using PRINT and GET. The programmer must read the echo and discard those characters. Use SETCOM(9600, 8, 1, 0, 2, 0) ' no xon/xoff Don't set the 2-wire flag because that is only for Modbus. ...
    • CANbus port check

      MC403, MC405, Euro404 and Euro408 Motion Coordinators that appear to have a failed CANbus port. Check that the CANIO_ADDRESS is set to 32 when using Trio CANIO mode or to 40 .. 42 when using CanOpen. The CANIO_ADDRESS is stored in Flash in the above ...