Author Topic: Powershell and AdvancedHMI  (Read 2840 times)

JimmyTang999

  • Newbie
  • *
  • Posts: 1
    • View Profile
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.

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


dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Powershell and AdvancedHMI
« Reply #1 on: May 02, 2024, 06:24:00 PM »
That's a good idea, I hadn't thought about doing it that way.