General Category > Open Discussion

Powershell and AdvancedHMI

(1/1)

JimmyTang999:
So to get this to work, you must purchase the .Net dll to make the driver stand alone.
It seems to be working very well. Worth every Penny!
Below is a simple example of connecting and reading a tag. It would be very easy to pipe data to a text file or DB from here with time stamp.


--- Code: ---# Load the AdvancedHMI.dll assembly
Add-Type -Path "C:\myDlls\EIP\ClxDriver.dll"

# Create an instance of the EthernetIPforCLXCom class
[ClxDriver.EthernetIPforCLX]$ethernetIP = New-Object ClxDriver.EthernetIPforCLX
#$ethernetIP | Get-Member

# Set PLC IP address and slot
$ethernetIP.IPAddress = "YourIPAddress"
$ethernetIP.ProcessorSlot = "0"

#read the data
$testString = $ethernetIP.Read("PLCTag");
Write-Output $testString


--- End code ---

dmroeder:
That's a good idea, I hadn't thought about doing it that way.

Navigation

[0] Message Index

Go to full version