Property | Type | Description | |
---|---|---|---|
IP | |||
MB | |||
MF | |||
MI | |||
MW | |||
QP |
Property | Type | Description | |
---|---|---|---|
IP2Int | int | ||
Int2IP | |||
ReadUntil | Response | ||
ReadUntil | Response | ||
ReadUntil | Response |
Method | Description | |
---|---|---|
BeginCmd ( byte buf, AsyncCallback cb, object state ) : IAsyncResult |
Sends buf byte array command to the PLC asynchronously. This method returns immediately. When the response is received cb will be invoked.
|
|
BeginConnect ( AsyncCallback cb, object state ) : IAsyncResult | ||
BeginRead ( int offset, int len, AsyncCallback cb, object state ) : IAsyncResult |
Starts an async reading.
|
|
BeginReadMulti ( ushort offsets, AsyncCallback cb, object state ) : IAsyncResult |
Begins an asynchronous multiple read.
|
|
BeginWriteRaw ( int offset, byte data, AsyncCallback cb, object state ) : IAsyncResult |
Writes raw data to PLC memory in the given offset asynchronously. When the write operation is complete cb will be invoked (from another thread).
|
|
Cmd ( byte buf ) : Response |
Sends a byte stream as a telnet command.
|
|
Cmd ( string cmd ) : Response |
Sends a string as a telnet command.
|
|
ConfigureNetwork ( |
Configures the networking configuration of the PLC. If either ip or dns is 0.0.0.0 or 255.255.255.255 the device puts itself in DHCP mode and tries to acquire IP automatically. If your configuration changed any of ip, nm or gw all connections to the device will be closed. After sending this command, this object will update its IP configuration regardless of any response and will try to reconnect during next data send. Note that reconnections will block. Also, note that, if a not working DNS configuration is provided, WMI feature of the PLC won't be usable.
|
|
Connect ( ) : void |
Attempts to connect to the PLC. This method will be automatically called if a data send attempt is made prior to connecting, partly because of your convenience and partly for making the library handle disconnections better. It is a good practice to initally call this method first to check if the password is correct.
|
|
Disconnect ( ) : void | ||
EndCmd ( IAsyncResult ar ) : Response |
Ends a BeginCmd asynchronous call.
|
|
EndConnect ( IAsyncResult ar ) : void | ||
EndRead ( IAsyncResult ar ) : |
||
EndReadMulti ( IAsyncResult ar ) : |
||
EndWrite ( IAsyncResult ar ) : void |
Ends a asynchronous BeginWriteRaw call.
|
|
PLC ( |
Connects to said PLC with given IP and password on default port 23.
|
|
PLC ( |
Initiates a PLC object. Does not automatically connect until said. Finder can be used to find IP addresses of PLC devices from PLC serial numbers (MAC addresses).
|
|
Read ( int offset, int len ) : |
Reads len bytes of data from offset sequentially.
|
|
ReadMulti ( ushort offsets ) : |
Reads 4-byte values from PLC memory at arbitrary offsets given as offsets. Usefull for reading non sequential data from PLC memory. Unlike alternatives, it does all the reading in a single network packet roundtrip, hence it is higher performance, yet harder to use.
|
|
Reboot ( ) : void |
Sends a reboot command to the PLC. Your connection will be lost.
|
|
Rewrite ( ) : void |
Rewrites last command
|
|
Run ( ) : bool |
Sends run command to the PLC.
|
|
Send ( byte data ) : void | ||
Send ( string str ) : void | ||
Stop ( ) : bool |
Sends stop command to the PLC.
|
|
ToString ( ) : string | ||
UpdateFirmware ( string path ) : void |
Updates the firmware.
|
|
UpdateNetwork ( ) : void | ||
Write ( int offset, byte data ) : void |
Writes whole data to PLC memory at offset, sequentially.
|
|
Write ( int offset, float value ) : void |
Writes a floating point value to the given offset.
|
|
Write ( int offset, int value ) : void |
Writes an Int32 value to the given offset.
|
|
Write ( int offset, ushort value ) : void |
Writes a UInt16 value to the given offset.
|
Method | Description | |
---|---|---|
IP2Int ( |
||
Int2IP ( int addr ) : |
||
ReadUntil ( ) : Response |
Reads until command prompt.
|
|
ReadUntil ( String untils ) : Response |
Waits until any of the strings in the untils array matched.
|
|
ReadUntil ( string str ) : Response |
Reads until a str matched
|
public BeginCmd ( byte buf, AsyncCallback cb, object state ) : IAsyncResult | ||
buf | byte | /// |
cb | AsyncCallback | Callback to be called when the operation is complete. |
state | object | Any state to be passed to |
return | IAsyncResult |
public BeginConnect ( AsyncCallback cb, object state ) : IAsyncResult | ||
cb | AsyncCallback | |
state | object | |
return | IAsyncResult |
public BeginRead ( int offset, int len, AsyncCallback cb, object state ) : IAsyncResult | ||
offset | int | |
len | int | |
cb | AsyncCallback | |
state | object | |
return | IAsyncResult |
public BeginReadMulti ( ushort offsets, AsyncCallback cb, object state ) : IAsyncResult | ||
offsets | ushort | |
cb | AsyncCallback | |
state | object | |
return | IAsyncResult |
public BeginWriteRaw ( int offset, byte data, AsyncCallback cb, object state ) : IAsyncResult | ||
offset | int | Offset of the memory location in the whole PLC memory in bytes. |
data | byte | Byte array of the data you want to write. This can contain sequential 4-byte integers, floats or 2-byte unsigned hosrts or 1-byte data. |
cb | AsyncCallback | Callback to be called when the operation is complete. |
state | object | Any state to be passed to |
return | IAsyncResult |
public Cmd ( byte buf ) : Response | ||
buf | byte | telnet command as byte array |
return | Response |
public ConfigureNetwork ( |
||
ip | IP Address of the PLC | |
nm | Netmask | |
gw | Gateway IP | |
dns | DNS IP | |
return | void |
public EndRead ( IAsyncResult ar ) : |
||
ar | IAsyncResult | |
return |
public EndReadMulti ( IAsyncResult ar ) : |
||
ar | IAsyncResult | |
return |
public PLC ( |
||
ip | ||
password | string | |
return | System |
public PLC ( |
||
ip | IP of the PLC | |
password | string | Password of the PLC |
return | System |
public Read ( int offset, int len ) : |
||
offset | int | Offset in bytes. |
len | int | Length in bytes. |
return |
public ReadMulti ( ushort offsets ) : |
||
offsets | ushort | List of offsets in bytes. |
return |
public UpdateFirmware ( string path ) : void | ||
path | string | The path. |
return | void |
public Write ( int offset, byte data ) : void | ||
offset | int | Offset in bytes. |
data | byte | Data to be written |
return | void |
public Write ( int offset, float value ) : void | ||
offset | int | Offset in bytes |
value | float | Float value |
return | void |
public Write ( int offset, int value ) : void | ||
offset | int | Offset in bytes |
value | int | Int32 value |
return | void |
public Write ( int offset, ushort value ) : void | ||
offset | int | Offset in bytes |
value | ushort | UInt16 value |
return | void |
public BoolArrayAccessor,ENDA.PLCNetLib.Accessors IP | ||
return |
public BoolArrayAccessor,ENDA.PLCNetLib.Accessors MB | ||
return |
public FloatArrayAccessor,ENDA.PLCNetLib.Accessors MF | ||
return |
public Int32ArrayAccessor,ENDA.PLCNetLib.Accessors MI | ||
return |
public UInt16ArrayAccessor,ENDA.PLCNetLib.Accessors MW | ||
return |