# for modbus
# Macros:
# P - the PV name prefix
# IP - The IP address or host name 

# Use the following commands for TCP/IP
# drvAsynIPPortConfigure(const char *portName, const char *hostInfo,
# 			 unsigned int priority, int noAutoConnect,
#			 int noProcessEos);

drvAsynIPPortConfigure("$(P)", "$(IP):502", 0,0,1)
dbLoadRecords("db/asynRecord.db","P=$(P),R=ASYN,PORT=$(P),ADDR=0,IMAX=0,OMAX=0")

# modbusInterposeConfig(const char *portName, modbusLinkType linkType,
#			int timeoutMsec, int writeDelayMsec)
modbusInterposeConfig("$(P)", 0, 2000, 0)


# Word Access at Modbus address 1
# Access 16 words as inputs
# Default data type unsigened integer
# drvModbusAsynConfigure("portName", "TcpPortName", slaveaddress,
#			modbusFunctions, modbusStartAddress, modbusLength,
#			dataType, pollMesec, "plcType")db
<<<<<<< Updated upstream
drvModbusAsynConfigure("RF1_In_Word", "$(P)", 0, 3, 1, 125, 0, 100, "RK")
=======
drvModbusAsynConfigure("RF1_In_Word", "$(P)", 0, 3, 1, 116, 0, 250, "RK")
>>>>>>> Stashed changes
dbLoadRecords("db/asynRecord.db","P=$(P),R=ASYN_IN,PORT=RF1_In_Word,ADDR=0,IMAX=0,OMAX=0")

# Access 5 words as outputs 
# Function code = 6 (single register)
# Default data type unsigned integer
<<<<<<< Updated upstream
drvModbusAsynConfigure("RF1_Out_Word", "$(P)", 0, 6, 1, 10, 1, 100, "RK")
=======
drvModbusAsynConfigure("RF1_Out_Word", "$(P)", 0, 6, 1, 10, 1, 1000, "RK")
>>>>>>> Stashed changes
dbLoadRecords("db/asynRecord.db","P=$(P),R=ASYN_OUT,PORT=RF1_Out_Word,ADDR=0,IMAX=0,OMAX=0")

# Enable ASYN_TRACEIO_HEX on sever
asynSetTraceIOMask("$(P)", 0,4)

 dbLoadRecords("db/ssa.db", "P=$(P)")




