How I can trigger inject node with input signal?

Hi, First of all, I have to say thank you for accepting me to this forum and sorry if my English is bad. I have a project with node-red and raspberry pi, I want to send an input signal to raspberry pi from a PLC and see the signal in a TCP server ( Hercules ). With inject node I can see the signal (1, 0) in Hercules at a specified time ( interval, interval between times, ...) but it doesn't work for me, What I need is to see the signal whenever it changes from 5 volts to 0 volts and vice versa. Please let me know if you have any suggestion? Thanks :slight_smile:

Can you show us the values returned from the PLC?
Can you confirm the values you want to send over TCP (strings? booleans? bytes?)

Can you confirm I understand your requirements ...

  1. When value from PLC changes from EXACTLY 5 to 0
    • Send 0 as a byte value to the TCP node - ONCE ONLY (until value changes)
  2. When value from PLC changes from EXACTLY 0 to 5
    • Send 1 as a byte value to the TCP node - ONCE ONLY (until value changes)
1 Like

the value I see in TCP server is string. like input1:1,input2:1,input3:0,input4:1, ... but they are sent every 10 second according my injection nodes setting .

Yes, exactly my requirement is this.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.