AdvancedHMI Software

General Category => Open Discussion => Topic started by: JimmyTang999 on May 02, 2024, 04:48:52 PM

Title: Powershell and AdvancedHMI
Post by: JimmyTang999 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.

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

Title: Re: Powershell and AdvancedHMI
Post by: dmroeder on May 02, 2024, 06:24:00 PM
That's a good idea, I hadn't thought about doing it that way.