Windows version
mkdir C:\path\to\your\project
cd C:\path\to\your\project
<?php | |
namespace PHP81_BC; | |
/** | |
* Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible) | |
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP. | |
* Note that output can be slightly different between libc sprintf and this function as it is using ICU. | |
* | |
* Usage: | |
* use function \PHP81_BC\strftime; |
<?php | |
function cif_validation ($cif) { | |
$cif = strtoupper($cif); | |
if (preg_match('~(^[XYZ\d]\d{7})([TRWAGMYFPDXBNJZSQVHLCKE]$)~', $cif, $parts)) { | |
$control = 'TRWAGMYFPDXBNJZSQVHLCKE'; | |
$nie = array('X', 'Y', 'Z'); | |
$parts[1] = str_replace(array_values($nie), array_keys($nie), $parts[1]); | |
$cheksum = substr($control, $parts[1] % 23, 1); | |
return ($parts[2] == $cheksum); | |
} elseif (preg_match('~(^[ABCDEFGHIJKLMUV])(\d{7})(\d$)~', $cif, $parts)) { |
Add-Type -Namespace Win32 -Name NativeMethods -MemberDefinition @" | |
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
public static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out UIntPtr lpdwResult); | |
"@ | |
function Send-SettingChange { | |
$HWND_BROADCAST = [IntPtr] 0xffff; | |
$WM_SETTINGCHANGE = 0x1a; | |
$result = [UIntPtr]::Zero |
Document included in the project https://github.com/fawno/Modbus
https://github.com/fawno/Modbus/blob/master/DDS238-2%20ZN-S%20Modbus.md
Register(s) | Meaning | Scale Unit | Data format | R/W |
---|