• 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
  Fieldbus Ports not working Schoko 13 78 June-29th-2020, 09:43 PM
Last Post: Armin@netPI
  Node-Red "http in"-Node not working DWxPro 8 50 June-19th-2020, 01:12 AM
Last Post: DWxPro
  using node.js on NIOT-E-TP151-EN-RE COswald 9 39 May-20th-2020, 12:54 PM
Last Post: Armin@netPI
  Error when using a node 'OpcUaServer' tad 6 38 May-12th-2020, 08:35 AM
Last Post: tad
  Node-RED log location SteveO 1 7 May-11th-2020, 07:53 PM
Last Post: Armin@netPI
  how to pick up PROFINET data and store them to OPC UA server on Node-RED/netPI. tad 7 48 March-16th-2020, 10:21 AM
Last Post: Armin@netPI
  Node Red stop working DSongra 1 11 February-12th-2020, 08:19 AM
Last Post: Armin@netPI
  After „Rebuild“ of Docker neither the node-RED nor the dashboard can be accessed MAK 4 22 January-31st-2020, 02:14 PM
Last Post: MAK
  How to save node-red flows persistent? hsammer 2 33 November-5th-2019, 03:50 PM
Last Post: hsammer
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 6 98 October-21st-2019, 10:30 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)