Wake On Lan
Charles Law
Posts: 72
Does anybody try to switch on a PC through Wake On LAN using NI Controller?
0
Comments
Try this, it works:
Please try it....
Regards, Leon
Thanks for sharing.
Cheers,
Charles
Adam
I have a VDR (Reelbox) with the MAC Aresse: 00-1B-73-71-64-58
Is it really MAC = "$00,$1B,$73, $71, $64, $58"
Unfortunately does not work
From the computer works with Windows 00-1B-73-71-64-58 (program WAKEON)
Thank you
(Based on the MAC above)
nHexToNumber[1] = HEXTOI('01')
nHexToNumber[2] = HEXTOI('A6')
.
.
nHexToNumber[6] = HEXTOI('C8')
sParsedMACAddress = "nHexToNumber[1],nHexToNumber[2],nHexToNumber[3],
nHexToNumber[4],nHexToNumber[5],nHexToNumber[6]"
SEND_STRING 0:2:0,"START,sParsedMACAddress,sParsedMACAddress,
sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,
sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,
sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,sParsedMACAddress,
sParsedMACAddress,sParsedMACAddress"
As far as I can tell, the problem was that as a string, each hex set ('01', 'A6', etc) is treated as 2 bytes ('0'+'1', 'A'+'6"...) giving 12 in total, but the MAC address can only be 6. By converting to an integer, each number is sent as a single byte (MAC above translates to 1, 166, 35, 183, 69, 200)
At least, that's my understanding of it all - happy to get further clarification.
May not be the cleanest way to do it - but at least I know it works!
Sendstring's method works for me in 2019, long live netlinx
changed port to port 9 for my network though !
If you are trying to use the WoL module in 2024, I might have some help for you.
The module is looking for a Char value, so give it one.
I found this works for the mac address:
Char cMac_Hex[6] = {$BE,$EF,$70,$FE,$ED,$FF}
And this doesn't:
integer cMac_Hex[6] = {$BE,$EF,$70,$FE,$ED,$FF}