Now user wants that DHCP to assign the IP and based on the ping response being successful with the response information (like Device Type: SP650 and Firmware Version: 1.1.73) user should be able to select the checkbox to those devices he wants to update the software
Code: Select all
cd "C:\Program Files\Weir Minerals\RSP Firmware\RSP Firmware\"
$rspIps = "192.168.29.20","192.168.29.21","192.168.29.22","192.168.29.23","192.168.29.24","192.168.29.25","192.168.29.26","192.168.29.27"
foreach ($rspIp in $rspIps)
{
if (Test-Connection $rspIp -Count 1 -ea 0 -Quiet)
{
if((($rspIp.Substring(11,2)) % 2) -eq 0)
{
.\SinetProg.exe /i /a:$rspIp
.\SinetProg.exe /f:20181109-01_SP650_V1.1.073.bin /a:$rspIp
.\SinetProg.exe /i /a:$rspIp /r:a
}
if((($rspIp.Substring(11,2)) % 2) -ne 0)
{
.\SinetProg.exe /i /a:$rspIp
.\SinetProg.exe /f:20181130-01_DAQ650_V1.1.075.bin /a:$rspIp
.\SinetProg.exe /i /a:$rspIp /r:a
}
}
else
{
Write-Output " $rspIp could not be pinged"
}
}Code: Select all
PS D:\RSP Firmware Update\RSP_Firmware> .\SinetProg.exe /i /a:192.168.29.20
Device Type: SP650
Device Revision: 0
Encoded Serial Number: 1922376193
Real Serial Number: SP094967295
Firmware Version: 1.1.73
Device Time: August 7, 2019 10:58:06
Device Status: x0000
Device Uptime: 19:33:22Code: Select all
Param()
# Your code goes here.
Add-Type -AssemblyName PresentationFramework
#fetch the SiteName from combobox
$SiteName = AI_GetMsiProperty EDIT_1_PROP
if ($SiteName -match '[^a-zA-Z0-9.-_]')
{
[System.Windows.MessageBox]::Show('The value is invalid. Please re-enter the value.')
$SiteNameValidation =$false
}
else
{
AI_SetMsiProperty CONDITION_PROP "true"
$prop = AI_GetMsiProperty CONDITION_PROP
#[system.windows.messagebox]::show("$prop")
$SiteNameValidation = $true
}
#fetch the EquipmentPhysicalIdentifier from combobox
$EquipmentPhysicalIdentifier = AI_GetMsiProperty EDIT_2_PROP
if($EquipmentPhysicalIdentifier.length -gt 12)
{
[System.Windows.MessageBox]::Show('The value is invalid. Please re-enter the value.')
$EqIdValidation =$false
}
Code: Select all
PS C:\Program Files\Weir Minerals\RSP Firmware\RSP Firmware> cd "C:\Program Files\Weir Minerals\RSP Firmware\RSP Firmware\"
$rspIps = "192.168.29.20","192.168.29.21","192.168.29.22","192.168.29.23","192.168.29.24","192.168.29.25","192.168.29.26","192.168.29.27"
foreach ($rspIp in $rspIps)
{
if (Test-Connection $rspIp -Count 1 -ea 0 -Quiet)
{
if((($rspIp.Substring(11,2)) % 2) -eq 0)
{
$a = .\SinetProg.exe /i /a:$rspIp
Write-output "Your Current " $a[0] "and your current " $a[4]
}
if((($rspIp.Substring(11,2)) % 2) -ne 0)
{
$b = .\SinetProg.exe /i /a:$rspIp
Write-output "Your Current " $b[0] "and your current " $b[4]
}
}
else
{
Write-Output " $rspIp could not be pinged"
}
}
Your Current
Device Type: SP650
and your current
Firmware Version: 1.1.73
Your Current
Device Type: DAQ650
and your current
Firmware Version: 1.1.75
192.168.29.22 could not be pinged
192.168.29.23 could not be pinged
192.168.29.24 could not be pinged
192.168.29.25 could not be pinged
192.168.29.26 could not be pinged
192.168.29.27 could not be pinged
FOLLOW US
Get the latest news in Application Packaging