MT-CONNECT, e.Variables

Good morning everybody,
i need to read this from "mt-connect":

msg.payload.MTConnectStreams.Streams[0].DeviceStream[0].ComponentStream[3].Events[0].e.Variables[0]_

but the string "e:Variables" write in this mode is not correct. Which is the correct syntax?

Help me.

thanks

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

"e:variables" is correct. I need only know how to write this into "edit function node".

For example:

msg.payload.MTConnectStreams.Streams[0].DeviceStream[0].ComponentStream[3].Events[0].+"e:Variables"+[0]._

This mode make an error.

Easy answer - Open the link i posted - it shows you how to get the path to any variable

Harder answer - Learn about JavaScript Bracket notation.

1 Like

Cattura

I tried to write this:

msg.payload.MTConnectStreams.Streams[0].DeviceStream[0].ComponentStream[3].[Events][0].["e:Variables"][0]._;

but is not correct!

another possible solution?

The screenshot doesnt match the path because that is an error object. Something you are doing is throwing an error. Show us the debug (expanded) of the REAL message that you are trying to get this "e:Variables" from.

Something like this...
2020-11-27_08-42-51

did you copy that path like the documentation shows?

data.json (11.4 KB)

sorry ,the complete path is this

Ok - and?

You still get the item path like I have explained...

["e:Variables"][0]._

????????????

What are you saying?

ok, so to save us both some time - here is the answer....

I can not properly help you if you do not read the information I provide or if you dont answer the questions.

I resolved the problem whih this:

msg.payload.MTConnectStreams.Streams[0].DeviceStream[0].ComponentStream[3].Events[0]["e:Variables"][0]._

Sorry, but i started work with node-red from only 3 month.

thanks

thanks

I resolved the problem with this:

msg.payload.MTConnectStreams.Streams[0].DeviceStream[0].ComponentStream[3].Events[0]["e:Variables"][0]._

Sorry, but i started work with node-red from only 3 month.

thanks

That is why it has been suggested numerous times that you read the Working with Messages page and in particular learn how to get the path to a variable by clicking the appropriate button in debug pane, from where you can paste it directly into your function.

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