10-04-2017 01:46 AM
10-04-2017 04:29 AM
Hallo again.
I tried to improve the code based on the comments from yesterday.
With 1 queue:
With 2 queues code A
With 2 queues code B:
10-05-2017 01:34 PM
Your 1 queue code is closer to what I do. One additional trick: you can store the timeout in a shift register. So my typical applications default to timeout of -1 (wait forever) and when commanded initialize and start reading data. When in the initialize state, I write a 100 into the timeout shift register so that I will go into the Read state if no messages were received. And when a Stop command is sent, I can set the timeout back to -1 (wait forever for another message). I typically then also have an Exit command that I use to stop the QMH.
10-05-2017 01:42 PM
With the exception of not using a type def for the Enum you have a fair grasp of the QSM There are thing I would have done different but, I haven't read your design specification.
OK, I am going to pick on your code just a little
First I just have to ask about the Counter Global.vi. My question really boils down to curiosity on what exactly was your thought process when you determined that you needed to pass a scalar value to subvis via global and update the value in the caller via wire? Seriously, I'm not trying to ask WTFWYT? but understanding your process will help us teach you better.
Next, I suggest you take a good long look at the QMH Template Documentation compare and contrast that with your 2 Queue A and B examples. Then make sure you support your computers ecology! Those bits and bytes can easily be recycled into useful code in the future.
10-06-2017 02:24 AM
Hi Crossrulz. I will try to incorporate that in my program. I will return with the code 🙂
10-06-2017 03:11 AM
Hi Jeff.
Thank you for you feedback
I’m normally always using type dif. In this quick example, I did not, I know.
The global. Again - it was just a quick example and have nothing to do with the program I’m working on.
What I’m really planning to do is get data from a BROOKS mass flow controller using at 0254.
The subvi in my program is in reality a sub which gets data from the 0254. The duration is around 1000 ms.
I actually newer – until now - using globals, and there are no use for it in this situation, I know.
This weekend I will have a look, at the QMH documentation. I think that’s a very good suggestion
Thank you for you feedback
I’m normally always using type dif. In this quick example, I did not, I know.
The global. Again - it was just a quick example and have nothing to do with the program I’m working on.
What I’m really planning to do is get data from a BROOKS mass flow controller using at 0254.
The subvi in my program is in reality a sub which gets data from the 0254. The duration is around 1000 ms.
I actually newer – until now - using globals, and there are no use for it in this situation, I know.
This weekend I will have a look, at the QMH documentation. I think that’s a very good suggestion
10-06-2017 08:59 AM
QMH - good
QSM -
Now regarding the Brooks 0254 and the serial interface. Good example of a bad interface. You ask for channel 2 and it give you channel 3. Even their shipping example includes a loop that repeats a command until it replies correctly. So don't be surprised if you start getting goofy values.
Ben
10-07-2017 04:57 AM
Ben ! Now I get a little nervous - Can you elaborate on that?
10-09-2017 07:50 AM
@Michael.Koppelgaard wrote:
Ben ! Now I get a little nervous - Can you elaborate on that?
Exactly what THAT would you to read more about?
Ben