mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
143 stars 91 forks source link

Custom Macros in Fanuc adapter #496

Closed smtpl-iiotian closed 2 days ago

smtpl-iiotian commented 3 weeks ago

Hi, I updated adapter.ini for each individual adapter as

[macros] [cycletime=803]

and devices.xml with event

DataItem category="EVENT" id="dev_01_cycletime_01" name="cycletime" type="CYCLETIME"

But I get UNAVAILABLE data on http://localhost:5000/current

robot-ranger commented 3 days ago

this repo is for the ccpagent; it looks like you are trying to run one of the old adapters. you should be aware that those adapters are pretty old and may not be compatible with current mtconnect.

wsobel commented 3 days ago

Try:

[macros]
cycletime=803

The syntax is wrong.

smtpl-iiotian commented 3 days ago

@robot-ranger thanks for your reply. I am using Fanuc-MTConnect-Agent and it is based on the cppagent project as mentioned there.

smtpl-iiotian commented 3 days ago

@wsobel I tried with above syntax but the adapter remains in Stopped state after the initial Running state. Refering fanuc_adapter.cpp as in below link. https://github.com/mtconnect/adapter/blob/76a04e19f6d37f4f36516978dc1a8526a3439a02/fanuc/fanuc_adapter.cpp#L172

For an event i.e., path macro, adapter.ini was kept as [macros] [cycletime=803] devices.xml was kept as DataItem category="EVENT" id="dev_01_cycletime_01" name="cycletime" type="CYCLETIME"

For a sample, adapter.ini was updated to [macros] cycletime=803 devices.xml was updated as DataItem category="SAMPLE" id="dev_01_cycletime_01" name="cycletime" subType="ACTUAL" type="CYCLETIME"

I tested above 2 cases but the adapter in the Fanuc-MTConnect-Agent changes to Stopped state for both.

wsobel commented 2 days ago

can we move th9s discussion to the adapter repository since it has nothing to do with the agent?

smtpl-iiotian commented 2 days ago

@wsobel fine I will close this issue and put it in the adapter