03-13-2014 11:26 AM
I'm attempting to write a VI to control a multi zone furnace. The board(s) used to control the furnace take about 25 different commands.
I'll be sending commands (strings) over a serial port. Commands take differing arguments so there are variable inputs for concatenating
a string into a valid command before writing to the serial port. Further complicating things, each string includes a checksum at the end.
Currently users are expecting to select a command (in simple english, not what is sent over the port) and provide added info based on
the command. I then gather this up, format a string that the board understands and write it to the port.
I'm guessing the Case structure is what I should be using. But as far I can tell (I'm a newbie so I can't sure of much), for each case in the
structure it appears that the inputs to the concatenation have to be the same in type, order and number. I keep getting errors if I attempt
to use a Case structure where one case uses 2 strings to concatenate into a command, another uses 5 strings etc. I get unwired element
errors.
Is the Case structure limited in the way I'm seeing or is there a way around this (something a newbie doesn't know)?
Or is there a different structure I should be using?
I've attached 2 VIs (both are just baby steps at this point, the "bad" is expecting more strings than there are).
Any advice would really help.
Thanks,
Dave
03-13-2014 11:32 AM
Since you are just concatinating strings, just output empty strings out of those cases that shouldn't have that input.
03-13-2014 11:41 AM
.... Or move the concatenate function inside the case structure.
03-13-2014 11:48 AM
Thanks crossrulz, aputman,
I'll try both ways and see how things go. It's a pain in the neck being a newbie!
03-13-2014 12:43 PM
@dkl234 wrote:
Thanks crossrulz, aputman,
I'll try both ways and see how things go. It's a pain in the neck being a newbie!
But you have the right attitude and that makes all the difference in the world!
03-13-2014 01:22 PM
We were all newbies at one point. Just keep asking questions and learn from our mistakes.
03-13-2014 03:44 PM
I think a State Machine with an Event Structure is right up your alley for this project. 😉
03-14-2014 07:27 AM
Eric
You might be right. I'm at the start of the learning curve on labview. One thing is for certain, I don't know enough about labview
to know when I might be going down the wrong road. So in the mean time it's a number of mini vis until I can see the light
on the overall project.
03-14-2014 07:45 AM
03-14-2014 08:57 AM
I use the loaded templete examples as a good starting point and go from there. You can always come here if you get stuck. I do.