1
Open Discussion / Powershell and AdvancedHMI
« on: May 02, 2024, 04:48:52 PM »
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.
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: [Select]
# 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