• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Help with fieldbus node
#1
Hi.

I am trying to receive and send boolean value to my test PLC with the fieldbus node. I was able to rec from the PLC without error. But i was unable to send to the PLC through the fieldbus output node. How can i test this?

Error message : OUT_NODE expects the property 'payload' as an object

Attached are the snapshots.        
  Reply
#2
Hi there,

the fieldbus nodes have a readme info text as any node under node-red has. Just click the node and click the "i" button to read it.

There you will find an example how to hand over data to the fieldbus.

>
msg.payload has to be a JSON object containing the property "value" holding the value(s) to be written to the signal specified
Example:
msg.payload.value = [9,8,7,6] will write a signal of type 'array' with 4 elements
msg.payload.value = 1 will write a discrete signal
msg.payload.value = "true" will also write a discrete signal of type bit
<

I have one remark. We can't see your screen shots. You have specifically press "add attachment" to append a screen shot to a post. Just selecting a file is not enough.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
I've updated the screenshots. So in this case, i have to include a change node in between the inject and fieldbus out node?

Btw, i was following the pdf documentation as per snapshot

   
  Reply
#4
Dear Farani,

you found a bug in the documentation. The documentation of the inject node in relation to the fieldbus node is wrong. Thank you for your remark

It is not correct to inject a "number" type value to "msg.payload" like as it is documented today.

Instead you have to use "JSON" type value and then inject a msg.payload value {"value":2} as example.

Look how I did it:

   

What you can of course do is to use a simple inject node that connects to a function node where you write a javascript code like this:

msg.payload = {};
msg.payload.value = 2;

and then connect it to a fieldbus node. Look here:

   

Sorry for this inconvenience. I already wrote the documentation team an email to get it corrected in future in the manual.

Thx
Armin


Attached Files Thumbnail(s)
   
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
(August-15th-2019, 06:32 AM)Armin@netPI Wrote: Dear Farani,

you found a bug in the documentation. The documentation of the inject node in relation to the fieldbus node is wrong. Thank you for your remark

It is not correct to inject a "number" type value to "msg.payload" like as it is documented today.

Instead you have to use "JSON" type value and then inject a msg.payload value {"value":2} as example.

Look how I did it:



What you can of course do is to use a simple inject node that connects to a function node where you write a javascript code like this:

msg.payload = {};
msg.payload.value = 2;

and then connect it to a fieldbus node. Look here:



Sorry for this inconvenience. I already wrote the documentation team an email to get it corrected in future in the manual.

Thx
Armin

Much appreciated. Thank you very much.
  Reply
#6
By the way for all others who are interested in the common "Fieldbus Node" video for Hilscher's Edge Gateways: 

Here is the link to it https://youtu.be/TmNgbGS_ydE
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Node Red configuration LucioFiam 3 1,601 November-30th-2022, 05:14 PM
Last Post: Armin@netPI
  secure node-red with a username and password Christian_Rau 3 2,799 December-3rd-2021, 11:06 AM
Last Post: Armin@netPI
  cifx0 and Node-Red fabio1975 5 3,047 November-22nd-2021, 01:13 PM
Last Post: Armin@netPI
  Node red web UI issue DSongra 3 3,116 July-22nd-2021, 02:47 PM
Last Post: Armin@netPI
  Node-RED 'projects' possible on netPI? JG_KIT 2 2,280 July-20th-2021, 01:11 PM
Last Post: JG_KIT
  Node-RED: OpcUa Client node tad 4 4,326 June-9th-2021, 08:51 AM
Last Post: tad
  2 MAC addresses for fieldbus RJ45 ports tad 2 2,072 March-11th-2021, 01:17 PM
Last Post: tad
  Internet on the fieldbus-side COswald 21 8,909 March-1st-2021, 07:41 AM
Last Post: COswald
  Accessing a modbus device connected to RTE port from Node-RED tad 10 7,801 October-2nd-2020, 07:21 AM
Last Post: Armin@netPI
  5 x NL 50-Mpi and Node Red like colector data? Jotarod 4 3,845 September-14th-2020, 01:59 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)