-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from nusaqib/master
Thanks, this is very nice.
- Loading branch information
Showing
5 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ envPaths | |
dllPath.bat | ||
auto_settings.sav* | ||
auto_positions.sav* | ||
RELEASE.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!../../bin/linux-x86_64/modbusApp | ||
|
||
# fc17_modicon.cmd | ||
|
||
|
||
< envPaths | ||
|
||
dbLoadDatabase("../../dbd/modbusApp.dbd") | ||
modbusApp_registerRecordDeviceDriver(pdbbase) | ||
|
||
# Use the following commands for TCP/IP | ||
#drvAsynIPPortConfigure(const char *portName, | ||
# const char *hostInfo, | ||
# unsigned int priority, | ||
# int noAutoConnect, | ||
# int noProcessEos); | ||
drvAsynIPPortConfigure("Modicon984","192.168.1.52:4001",0,0,0) | ||
#modbusInterposeConfig(const char *portName, | ||
# modbusLinkType linkType, | ||
# int timeoutMsec, | ||
# int writeDelayMsec) | ||
modbusInterposeConfig("Modicon984",1,500,0) | ||
|
||
#drvModbusAsynConfigure(portName, | ||
# tcpPortName, | ||
# slaveAddress, | ||
# modbusFunction, | ||
# modbusStartAddress, | ||
# modbusLength, | ||
# dataType, | ||
# pollMsec, | ||
# plcType); | ||
# modbusStartAddress=0 as it doesn't matter in function 17 | ||
# modbusLength is device-specific and equal to number of bytes in response of function 17 | ||
# Modicon-984 provides 9 bytes in response | ||
drvModbusAsynConfigure("Mod984_slaveID","Modicon984",32,17,0,9,0,1000,"Modicon") | ||
|
||
# Enable ASYN_TRACEIO_HEX on octet server | ||
asynSetTraceIOMask("Modicon984",0,4) | ||
# Enable ASYN_TRACE_ERROR and ASYN_TRACEIO_DRIVER on octet server | ||
#asynSetTraceMask("Modicon984",0,9) | ||
|
||
# Enable ASYN_TRACEIO_HEX on modbus server | ||
asynSetTraceIOMask("Mod984_slaveID",0,4) | ||
# Enable ASYN_TRACE_ERROR, ASYN_TRACEIO_DEVICE, and ASYN_TRACEIO_DRIVER on modbus server | ||
#asynSetTraceMask("Mod984_slaveID",0,11) | ||
|
||
dbLoadTemplate("fc17_modicon.substitutions") | ||
|
||
iocInit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# asyn record for the underlying asyn octet port | ||
file "$(ASYN)/db/asynRecord.db" { pattern | ||
{P, R, PORT, ADDR, IMAX, OMAX} | ||
{Modicon984: OctetAsyn, Modicon984, 0, 80, 80} | ||
} | ||
|
||
# read byte#1 out of 9 bytes from Modicon-984 response | ||
file "../../db/longin.template" { pattern | ||
{P, R, PORT, OFFSET, SCAN} | ||
{Modicon984:, SlaveID_Byte1, Mod984_slaveID, 0, "I/O Intr"} | ||
} | ||
|
||
# read byte#7 out of 9 bytes from Modicon-984 response | ||
file "../../db/mbbiDirect.template" { pattern | ||
{P, R, PORT, OFFSET, MASK, SCAN} | ||
{Modicon984:, SlaveID_Byte7, Mod984_slaveID, 6, 0xFF, "I/O Intr"} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters