• 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]</b> 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
  EIP Node Red configurator mnieuzyla 4 23 September-10th-2019, 06:19 AM
Last Post: Armin@netPI
  Ready-to-deploy: full featured Node-RED container Armin@netPI 5 69 July-25th-2019, 06:16 AM
Last Post: Armin@netPI
  [SOLVED] WebConfig netpi-nodered-fieldbus JohnyD94 13 64 May-6th-2019, 12:20 AM
Last Post: JohnyD94
  Official Node-RED container Armin@netPI 0 17 April-5th-2019, 10:39 AM
Last Post: Armin@netPI
  [SOLVED] node-red Dashboard Docker Image for netPI? anrodriguez 1 23 February-7th-2019, 05:35 PM
Last Post: Armin@netPI
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 5 80 January-11th-2019, 08:06 AM
Last Post: Armin@netPI
  "node-red with NIOT-E-NPIX-EVA GPIO module" Docker image Eyad.Almolki 1 149 July-30th-2018, 06:22 PM
Last Post: Armin@netPI
  [SOLVED] hilschernetpi/netpi-nodered-fieldbus Fieldbus configurator can't be open Andreas 6 196 June-11th-2018, 09:12 AM
Last Post: Armin@netPI
  Node-Red MQTT with SSL/TLS can't connect to broker BFH_SAM2 6 243 May-18th-2018, 08:48 AM
Last Post: Armin@netPI
  fieldbus in error Schranz 7 164 March-13th-2018, 07:28 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)