HVAC-Talk: Heating, Air & Refrigeration Discussion banner

Add Action Slots in Program Block on N4 Niagara

Tags
#controls
12K views 19 replies 10 participants last post by  Special-K  
#1 ·
Hi, I was looking at the "program" module in the Niagara workbench. In this module, under templates, there is a program called "WithAction" that lets you add custom actions to the block. I want to use this feature but there is no way to add an action slot to the slot sheet. Generally, I would go to slot sheet -> right-Click -> Add Slot and the select the correct type (ie "baja:String") but for the action slot, it says "void (void)" or in some cases "void (baja:String)" depending on the return type of the action.

TLDR: How do I add an action slot to a program block in Niagara N4 workbench?:beat:
 
#2 ·
I moved this thread to the "Controls" forum where you should get more responses.

Please take not of this new forum, as the "Moved" icon in the other forum will only last a couple days.
 
Save
#3 ·
I don’t have my machine up right now, but an action slot on a program object is of type program:programAction or DynamicAction or something like that. I can’t remember exactly without looking at it, but it’s from the program module.

What do you plan to do with this?
 
#4 ·
Hi, The "program:programAction" was the slot i was looking for. Thank you for your help. I have a feeling that I'll probably end up using the DynamicAction Slot as well

I am planning to make a custom action named "refresh" and another one named "check connection". I'm using the program block to talk to an API and Although the database refreshes every 15 seconds, I also wanted to add the functionality to manually refresh the data. I personally think its a cool project and would post a picture of it but I'm new to this website and don't have 7 threads yet to do so.
 
#6 ·
Basically, Using an API to bring Data in. Using a program block to parse the data from XML to String, Enum, numeric, etc. I was looking into action slots because I wanted there to be a "refresh" option that refreshed all the data. Still working on it. Here is the wire sheet of my program along with the UI.

I have to do this because the controls system in question does not have a way to connect to tridum in a traditionally way (ie. BACnet) and they only provide a text based UI.



 
#10 ·
Not yet. I started working on this last month and basically had to make my own parser. It's good enough for what I need at the moment. I did take the time to understand the example and started working on it.
So, to answer your question, Your example did help. Its a work in progress. Also from your example, i have a better understanding of how the baja module are integrated in Niagara.

I do have a question. From what i heard, tritium gave up on developing baja. is that true? And what's up with the lack of documentation? Am I not looking in the right place?
 
#11 ·
No, that is not true. Baja is still ongoing. As a matter of fact, I was just doing some coding the other day and had to get help from one of the devs because what I was trying to accomplish required a private api and after explaining what I had to do, he stated that he put in a request for a public api to be added.

Documentation is not the greatest when first starting out. Once you get well versed, the baja api docs are all you need.
 
#13 ·
I spent a lot of time on this and came to the conclusion that its better to request data in JSON format instead of XML. Niagara had a built-in pallete to parse JSON and this format is more or less the golden standard of web API's.
 
You have insufficient privileges to reply here.