This software drives the GE Fanuc Embedded Systems OctalUart family of Industry Pack modules to communicate with a number of RS-232, RS-422, and RS-485 devices. Note that this driver is not compatible with newer IP-OctalPlus modules as they use a different chipset.
The driver uses drvIpac for configuration of the carrier board plus access routines for the SCC2698 octalUart used in the IP modules. The driver implements a standard vxWorks terminal driver making use of the vxWorks tyLib system library.
The following is an example of a startup script (st.cmd) segment that creates and configures IP carriers, OctalUart IP modules, and tty devices. This example is compatible with both vxWorks and iocsh startup scripts.
# Initialize the drvIpac carriers. # ------------------------------- # carrier#0 ipacAddMVME162 "A:m=0xe0000000,64 l=3,2" # carrier#1 ipacAddVIPC616_01 "0x6400,0xB0000000" # carrier#2 ipacAddTVME200 "602fb00" # Allocate the number of tyGSOctal modules to support. # ---------------------------------------------------- tyGSOctalDrv 6 # Initialize IP Octal modules. # ---------------------------- # tyGSOctalModuleInit(char *moduleID, char *ModuleType, int irq_num, # char *carrier#, int slot#) # moduleID - assign the IP module a name for future reference. # ModuleType - "232", "422", or "485". # irq_num - interrupt request number. # carrier# - carrier# assigned from the ipacAddCarrierType() call. # slot# - slot number on carrier; slot[A,B,C,D] -> slot#[0,1,2,3]. # Init two IP-Octal modules from the MVME162 carrier; the 1st module is in # slot A, the second module is in slot B. tyGSOctalModuleInit "Mod0", "232", 0x80, 0, 0 tyGSOctalModuleInit "Mod1", "232", 0x81, 0, 1 # Init two IP-Octal modules from the 1st SBS VIPC616_01 carrier; the 1st # module is in slot A, the 2nd module is in slot C. tyGSOctalModuleInit "Mod2", "232", 0x82, 1, 0 tyGSOctalModuleInit "Mod3", "232", 0x83, 1, 2 # Init two IP-Octal modules from the 2nd SBS VIPC616_01 carrier; the 1st # module is in slot B, the second module is in slot D. tyGSOctalModuleInit "Mod4", "485", 0x84, 2, 1 tyGSOctalModuleInit "Mod5", "485", 0x85, 2, 3 # Create tty devices. # ------------------ # tyGSOctalDevCreate(char *portname, int moduleID, int port#, int rdBufSize, # int wrtBufSize) # portname - assign the port a name for future reference. # moduleID - moduleID from the tyGSOctalModuleInit() call. # port# - port number for this module [0-7]. # rdBufSize - read buffer size, in bytes. # wrtBufSize - write buffer size, in bytes. # Create two tty ports on Mod0 with portname based on the convention; # "/tyGS/carrier#,slot#/moduleID/port#". tyGSOctalDevCreate "/tyGS/0,0/0", "Mod0", 0, 512, 512 tyGSOctalDevCreate "/tyGS/0,0/1", "Mod0", 1, 512, 512 # Initialze all the remaining uninitialized Mod0 ports; i.e., /tyGS0/0/[2-7]. tyGSOctalDevCreateAll "/tyGS/0,0/", "Mod0", 512, 512 # Initialize all the Mod1 ports. tyGSOctalDevCreateAll "/tyGS/0,1/", "Mod1", 512, 512 # Initialize all the Mod2 ports. tyGSOctalDevCreateAll "/tyGS/1,0/", "Mod2", 512, 512 # Configure the ports. # -------------------- # STATUS tyGSOctalConfig (char *portname, int baud, char parity, int stop, # int bits, char flow) # portname - portname from either the tyGSOctalDevCreate() call or # the tyGSOctalDevCreateAll() call. # baud - baudrate; 1200,2400,4800,9600,19200,38400. # parity - even - 'E', odd - 'O', or none - 'N'. # stop - stop bits; 1 or 2. # bits - data bits; 5,6,7 or 8. # flow - flow control; hardware - 'H' or none - 'N'. tyGSOctalConfig "/tyGS/0,0/0", 38400, 'N', 1, 8, 'N' # Ports default to 9600, 'N', 1, 8, 'N'
When running EPICS base 3.15 or higher, the iocshLoad command can be used with the tyGSOctal.iocsh script included in this module's top-level iocsh directory. The following shows an example of such a use.
# Initialize the drvIpac carriers. # ------------------------------- # carrier#0 ipacAddMVME162 "A:m=0xe0000000,64 l=3,2" # carrier#1 ipacAddVIPC616_01 "0x6400,0xB0000000" # carrier#2 ipacAddTVME200 "602fb00" # Initialize an IP-Octal module called MOD0 that's located in slot A of # of the first initialized carrier (MVME162), and then create 8 tty # ports labeled /tyGS/0,0/0 through /tyGS/0,0/7 on that module. # Also tell the script that you will be initializing up to 5 more modules. iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD0, INT_VEC=0x80, CARRIER=0, SLOT=0, TYPE=232, MAX_MODULES=6") # Initialize the IP-Octal module in slot B of the MVME162, the tty ports # created will be labeled /tyGS/0,1/0 through /tyGS/0,1/7 iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD1, INT_VEC=0x81, CARRIER=0, SLOT=1, TYPE=232") # Init two IP-Octal modules from the 1st SBS VIPC616_01 carrier; the 1st # module is in slot A, the 2nd module is in slot C. iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD2, INT_VEC=0x82, CARRIER=1, SLOT=0, TYPE=232") iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD3, INT_VEC=0x83, CARRIER=1, SLOT=2, TYPE=232") # Init two IP-Octal modules from the 2nd SBS VIPC616_01 carrier; the 1st # module is in slot B, the second module is in slot D. Both are RS485 # instead of RS232 iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD4, INT_VEC=0x84, CARRIER=2, SLOT=1, TYPE=485") iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=MOD5, INT_VEC=0x85, CARRIER=2, SLOT=3, TYPE=485")
The RTEMS version of this driver provides a similar set of commands. Significant differences are: