The idea was to setup a simple counter. If there is no more counting pulse after a set time, the counter is reset to 0 at the next counting pulse. Everything works perfectly, except when the counter is automatically set to 0, there have to be 2 counting pulses before going to state 1, there should be only one because the counter is at 0. Where did I make a mistake? code(* read system time *) tx := DWORD_TO_TIME(T_PLC_MS()); (* Rising edge detection *) fb1 (CLK:=in); (* count the number of clicks...
I have a small code running: OneShot(CLK:= Signal); IF OneShot.Q = TRUE THEN Out := NOT Out; END_IF The "Out" variable is also changed on another location (modbus coil). If I create a FB from this code, it is not possible to control the variable connected to the output from the other location. What could be the cause and solution?
I'm quite lost in this mather, wireshark does not show the above at all with the data sent from codesys. When I do it with the powershell script, I have exactly the same result as above. should I use the buffer_to_String function from oscat to extract a string from the array of bytes? And sent this with httpclient?
so the Data array should be sent by the httpclient? I have no errors, but when I check the traffic with wireshark or tcpdump it is not like the traffic generated from the powershell script. I've tried also the oscat buffer_to_string function and sent the resulting string, but I think the "0"s are causing trouble, not sure however because this is unknown territory for me.
Thank you for the support. Still no success with the format, I need to sent one "0", $0 isn't accepted and $00 doest not work. When I check the traffic with wireshark on the IP address, it is totally different compared to the powershell script.
Thank you for the support. Still no success, I need to sent one "0", $0 isn't accepted and $00 doest not work. When I check the traffic with wireshark on the IP address, it is totally different compared to the powershell script.
I'm struggling to sent a string in byte format to an Onkyo receiver. The idea was to use the httpclient fb and sent the wstring sTest: WSTRING(200):="73 83 67 80 0 0 0 16 0 0 0 8 1 0 0 0 33 49 80 87 82 48 49 13"; to it Somewhere in the process I need to do a hex to byte because it should be sent as bytes. Here I'm stuck. I can control it by a powershell script (attachment), but I cannot convert this script to codesys.