03-02-2020 04:12 AM
Good morning,
I hope you had a great weekend. I started playing around a little bit with the Alarms. So I used a boolean array to read out the possible alarms. This worked for the command flags (and yes, they are reversed in order). Somehow I don't read out a binary number for the alarm flags. I am not sure why that is.
Next would be the "set temperature". Not sure how to tackle that issue. Do I put this in the "main" VI somewhere in between? Or do I need a completely new "line" for that?
03-02-2020 07:23 AM
@Torracc wrote:
Somehow I don't read out a binary number for the alarm flags. I am not sure why that is.
Well, your data is showing 0 for the alarm flags. So it looks right to me. Do note that I did not look at your VI to verify.
03-02-2020 07:29 AM
Based on a quick check with your input values, I did the following
It seems that you're getting "00" for the alarms, which seems reasonable. Are you expecting one or more to be true?
Probably they're all 0/False until something is going wrong...
As a side note (and a very minor point) you can right click on the Feedback Node and choose "Change Direction" to make it a little easier to wire in some (including your) conditions.
03-02-2020 07:49 AM
@cbutcher wrote:
It seems that you're getting "00" for the alarms, which seems reasonable. Are you expecting one or more to be true?
Probably they're all 0/False until something is going wrong..
Well I was expecting a 00000000. There are 8 bits and I thought that they all are 0 as long as there is no error. And then the 0 change to 1 if there is an error. Like with the control Flags. Maybe I am wrong. The problem is, that I actually can't manually trigger an error to check this. At least not at the moment. Maybe I can check for the errors later on.
As a side note (and a very minor point) you can right click on the Feedback Node and choose "Change Direction" to make it a little easier to wire in some (including your) conditions.
Yeah my code is a little bit messy 🙂 Thanks for that tip
03-02-2020 08:34 AM
@Torracc wrote:Well I was expecting a 00000000.
That is just a display issue. Right-click on your indicator and choose "Display Format..." You can edit the format however you want. I would go into the Advanced Formatting and change it to be %08x. Well, actually I use this plugin (shameless plug): Format Numeric Quick Drop Plugin
03-02-2020 09:51 AM
@crossrulz wrote:
@Torracc wrote:Well I was expecting a 00000000.
That is just a display issue. Right-click on your indicator and choose "Display Format..." You can edit the format however you want. I would go into the Advanced Formatting and change it to be %08x. Well, actually I use this plugin (shameless plug): Format Numeric Quick Drop Plugin
I had it set to binary just like the control flag...didn't work. Now I changed it to %08x and it works. Thanks a lot!
03-03-2020 03:04 AM
Good morning,
I was able to implement the "set temperature" idea
However, this only works with it's own VISA resource. I was not able to use the same VISA resource. Because I doubt that you would need to set up a VISA resource every time you set up a new function. Also, I think that the Set Temperature part has to be in the same loop. Because I am not able to set the temperature on the fly. I need to restart the program in order to get it working. But the overall frame works I guess.
03-03-2020 07:08 AM
Because your Set Temperature part is standing all by itself outside the loop where it will only execute once!
Put it in side the loop. You can put it in a case structure so that it only changes when you tell it to such as through a button press or when the value of the control changes.
03-03-2020 07:14 AM - edited 03-03-2020 07:29 AM
You need to follow some previous advice and create subVIs. You definitely want a VI just for sending a command. You should also make one for each command you want to send. This will help immensely in just organizing your code. It would also be beneficial if you used a cluster for your status to even better organize it.
Also with organizing your code, you really should be using a project to organize your VIs. I would also make a library that is the API for controlling the chiller.
Finally, it is time to pull out the Event Structure. You can use the Timeout event to ask for the status and use the Set Temperature Value Change event for sending the command to set the temperature.
I just did some massive cleaning up and got you this far. See if you can handle the next command.
EDIT: I just noticed the interface VI was not in the zip file. Just added it.
03-03-2020 07:53 AM
@crossrulz wrote:
You need to follow some previous advice and create subVIs. You definitely want a VI just for sending a command. You should also make one for each command you want to send. This will help immensely in just organizing your code. It would also be beneficial if you used a cluster for your status to even better organize it.
So for me as a beginner I find the use of SubVIs not so easy. For me it is way easier if I can see the compelte code the whole time. THis, I can try to follow everything and find a possible error and its solution. I get that the use of SubVIs is useful, but I struggle a little bit with them at the moment. Maybe later I can get used to them a little bit.