User Tools

Site Tools

한국어

cubloc:mpsource:index

Mpsource

MPsource ID, RelayNumber, OnOff

ID The ID of the module
RelayNumber Index of the individual relay (0 ~ 7)
OnOff Whether to turn the relay on or off (on = 1, off = 0)

Command to turn on/off a pin on the MD-DOSO8 DC source output module.

MPSource 1, 2, 1      ' Turn on module 1, pin 2

Using the CT1820 with the Modport

The Modport is a modular, RS-485, Modbus field I/O controller from Comfile Technology featuring digital input and output, analog input, temperature sensing, and a variety of other features.

The CT1820 can be connected to the Modport to expand its I/O capabilities. The CT1820 features a library of built-in commands to make it simple and easy to communicate with the Modport.

Please refer to the illustration below to connect the CT1820 to the Modport.

Modport Test Program

The following program reads the status of 8 inputs on the MD-DIDC8 digital module, and simultaneously outputs each status to the MD-DOSO8 digital output module

    #include "CT18XX"
    Dim TX1 As Integer
    Dim TY1 As Integer
    On Pad Gosub TouchOccur
    '
    '********************* Main Do Loop ************************
    '
    Locate 1,1
    Print "MD-DIDC8 Input Status"
    Locate 3,3
    Print "7 6 5 4 3 2 1 0"
    Locate 3,4
    Print "==============="
    Do
    Locate 2,5
    Print hex2 MPin(1,7),hex2 MPin(1,6),hex2 MPin(1,5), _ 
         hex2 MPin(1,4),hex2 MPin(1,3),hex2 MPin(1,2),hex2 MPin(1,1),hex2 MPin(1,0)
    MPsource 2,0,MPin(1,0)
    MPsource 2,1,MPin(1,1)
    MPsource 2,2,MPin(1,2)
    MPsource 2,3,MPin(1,3)
    MPsource 2,4,MPin(1,4)
    MPsource 2,5,MPin(1,5)
    MPsource 2,6,MPin(1,6)
    MPsource 2,7,MPin(1,7)
    Wait 500
    Loop
TouchOccur:
    TX1 = Sys(10)
    TY1 = Sys(11)
    Pset TX1,TY1
    Ct18beep 10
    Return

Go CUBLOC home

cubloc/mpsource/index.txt · Last modified: 2016/07/17 21:36 by COMFILE Technology