From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Making the "Message Type" input required when scripting Send Message VIs for abstract messages

Solved!
Go to solution

Hey All,

 

Quick question regarding abstract messages. As a general rule, I make all messages from my actor to caller abstract messages so that I'm as de-coupled as possible. However, this means that I'm passing down a good number of specific instances of my messages to my nested actors. On occasion, if I'm in a hurry and I've just scripted a new abstract message, I'll drop the send message VI and wire up its inputs but forget to wire in the "Message Type" input.

 

Now, the good news is that doesn't break things/cause errors. The bad news is nothing happens when you run your code because the specific message isn't making its way down. Now that I've done this a few times I recognize the symptoms and can pinpoint the issue pretty quickly or look at DET to see what instances of things are being sent and received.

 

To remedy this I'm thinking of modifying the scripting code that makes the send message VI for abstract messages to make that terminal required so that LabVIEW will stop me from leaving it unwired. But, before I go modifying the framework tooling, I figured it was worth asking: is there any case where you wouldn't want to wire that input? I can't think of one, but that doesn't mean there isn't one :).

 

If there is one I'm assuming it's a corner case and I could always un-mark it as required if needed. But I figured I'd throw the idea out there. Thoughts? Has anyone already done this?

 

--Ryan

0 Kudos
Message 1 of 6
(4,219 Views)

I can't think of a situation in which you wouldn't connect a message to that input, it's required for the abstract message to actually go anywhere.

 

I'm a fan of this being a required input as well 🙂

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 2 of 6
(4,204 Views)

Except maybe in the situation where the abstract message contains no data, and you still need a decoupling of the nested actors from their callers, hmmm.

 

EDIT: but even here, the message input would still have to be connected for the caller to receive it and be able to dispatch a do.vi!

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 3 of 6
(4,203 Views)
Solution
Accepted by topic author Ryan_S

Yeah, that's what I figured. Did a quick walk of the scripter and it pulls that template from:

 

<LabVIEW>\resource\Framework\Providers\MessageMakerProvider\_Message Maker\_templates\Abstract Message Template\Send Template.vi

 

I opened that guy up, modified the terminal for the message type to be required, and ta da now my scripted abstract messages come out with that required :). That was easier than I thought it was going to be, lol.

 

--Ryan

Message 4 of 6
(4,191 Views)

Since making that required it's saved me twice from forgetting to wire that up (I guess the message instance input is just very forgettable).

 

Hey Craig_, since there doesn't seem to be a case in which you wouldn't wire that, can that get filed as a CAR so it gets changed for newer versions? I don't want to have to forever manually modify that 🙂

 

--Ryan

0 Kudos
Message 5 of 6
(4,144 Views)

I have been back and forth over this, and I cannot come up with any good use case for that being Recommended. Unless I hear objections, I'll change the template to Required for the LV 2018 release.

Message 6 of 6
(4,053 Views)