Gute IP Alternative um Geräte ein bzw. auszuschalten.
Der Code, nicht schön dafür umso seltener;-))
[highlight=epc]
// [NETio control]
NETioPort = 1234u16
NETioIP = 192.168.178.101
NETioSendDelay = 300u64
NETioInit=0b01
NETioCommandSent=0b01
NETioToggle=0b01
NETioTrigger=0b01
NETioOFF=0b01
NETioON=0b01
if pbutton(8,MultiMediaPageID)==1 then {
NETioToggle=!NETioToggle;
if NETioToggle then NETioON=1b01; pdisplay(8,$ON$,SWITCH,ACTIVE,GREY, MultiMediaPageID) endif;
if !NETioToggle then NETioOFF=1b01; pdisplay(8,$OFF$,SWITCH,INACTIVE,GREY, MultiMediaPageID) endif;
NETioTrigger=1b01
}endif
if NETioTrigger then connecttcp(NETioPort, NETioIP) endif
if after(NETioTrigger, NETioSendDelay) then sendtcp(NETioPort, NETioIP, $login admin admin$,13,10); NETioInit=1b01; endif
if after(NETioInit and NETioON, NETioSendDelay) then {
sendtcp(NETioPort, NETioIP, $port list 1111$,13,10);
NETioCommandSent=1b01;
NETioON=0b01
}endif
if after(NETioInit and NETioOFF, NETioSendDelay) then {
sendtcp(NETioPort, NETioIP, $port list 0000$,13,10);
NETioCommandSent=1b01;
NETioOFF=0b01
}endif
if after(NETioCommandSent, NETioSendDelay) then {
closetcp(NETioPort, NETioIP);
NETioInit=0b01;
NETioCommandSent=0b01;
NETioTrigger=0b01
}endif
//sendtcp(NETioPort, NETioIP, $quit$,13,10);
//causes the TCP port to go nuts
// [NETio control end]
[/highlight]
Der Code, nicht schön dafür umso seltener;-))
[highlight=epc]
// [NETio control]
NETioPort = 1234u16
NETioIP = 192.168.178.101
NETioSendDelay = 300u64
NETioInit=0b01
NETioCommandSent=0b01
NETioToggle=0b01
NETioTrigger=0b01
NETioOFF=0b01
NETioON=0b01
if pbutton(8,MultiMediaPageID)==1 then {
NETioToggle=!NETioToggle;
if NETioToggle then NETioON=1b01; pdisplay(8,$ON$,SWITCH,ACTIVE,GREY, MultiMediaPageID) endif;
if !NETioToggle then NETioOFF=1b01; pdisplay(8,$OFF$,SWITCH,INACTIVE,GREY, MultiMediaPageID) endif;
NETioTrigger=1b01
}endif
if NETioTrigger then connecttcp(NETioPort, NETioIP) endif
if after(NETioTrigger, NETioSendDelay) then sendtcp(NETioPort, NETioIP, $login admin admin$,13,10); NETioInit=1b01; endif
if after(NETioInit and NETioON, NETioSendDelay) then {
sendtcp(NETioPort, NETioIP, $port list 1111$,13,10);
NETioCommandSent=1b01;
NETioON=0b01
}endif
if after(NETioInit and NETioOFF, NETioSendDelay) then {
sendtcp(NETioPort, NETioIP, $port list 0000$,13,10);
NETioCommandSent=1b01;
NETioOFF=0b01
}endif
if after(NETioCommandSent, NETioSendDelay) then {
closetcp(NETioPort, NETioIP);
NETioInit=0b01;
NETioCommandSent=0b01;
NETioTrigger=0b01
}endif
//sendtcp(NETioPort, NETioIP, $quit$,13,10);
//causes the TCP port to go nuts
// [NETio control end]
[/highlight]