08-11-2023 01:32 AM
Hi Community,
this is my first post in this community, so please excuse if I make any mistakes.
I have searched the board for similar issues but I did not find anything.
I am still rather new to LabView and I am trying to build a small automated test bench.
Part of this is the control of a PWM controlled pump.
For this I am using a cDAQ-9179 with a NI9472 Module.
This module controlls a fast paced relais which then performs a pull down on PWM connection at the pump.
The pump does need a 12V PWM and directly controlling it with the 9472 does not work because ther is no active pull down.
Not to come to my issue:
When I start the VI nothing happens at the 9472.
But when I start a frequency task via NI MAX at the same module and output this works fine.
And after that I can also control the pump using my VI, even though MAX is not doing anything.
So every time I connect the cDAQ to my Laptop I first have to start this frequency task via MAX for just a short time and then I can use my VI.
It somehow seems as if the 9472 needs to "wake-up" or something.
The other modules in the cDAQ work fine and they work directly when using only the VIs for example the flow rate sensor goes to a NI9203 and that works immediately without MAX.
I hope this is just a small issue that can be fixed rather quickly.
Maybe I just made a mistake writing the VIs..
I attached both VIs to this post for you to check for any mistakes I made.
Thanks in advance
Tim
08-11-2023 07:23 AM
Hello, Tim.
When I opened PumpControl (first), it told me that it was looking for PWM-Pump, and opened with a Broken Arrow. "No problem", I thought, so I downloaded PWM-Pump and tried to open it. It "hung", showing a white Front Panel with some tiny lettering, never completing, until I forced it to close.
Curiously, when I then re-opened PumpControl, there was no error! It was somehow linked to PWM-Pump (inside the right-most While Loop), but I still couldn't open it. [Note -- both PumpControl and PWM-Pump seem to use the exact same VI Icon -- at least change the background color ...].
It seems to me likely that the problem is within PWM-Pump. Please check this, and make sure that you can open it on another PC running LabVIEW 2021. You might also consider saving both of these routines using "Save for Previous Version" and specify LabVIEW 2019, "just in case" something is flakey with your LabVIEW installation ...
Bob Schor
08-11-2023 08:20 AM - edited 08-11-2023 08:21 AM
Hallo Tim,
@Tim_Rothha wrote:
When I start the VI nothing happens at the 9472.
But when I start a frequency task via NI MAX at the same module and output this works fine.
And after that I can also control the pump using my VI, even though MAX is not doing anything.
So every time I connect the cDAQ to my Laptop I first have to start this frequency task via MAX for just a short time and then I can use my VI.
It somehow seems as if the 9472 needs to "wake-up" or something.
The other modules in the cDAQ work fine and they work directly when using only the VIs for example the flow rate sensor goes to a NI9203 and that works immediately without MAX.
Which error do you get in the first run of your VI? There should be an error when the cDAQ doesn't respond immediatly!
On your VI:
08-14-2023 12:43 AM
Hi Bob,
thanks for the reply.
I reatached a new save of the PWM-Pump VI as Labview 19 version.
Hope this works.
Kind regards
Tim
08-14-2023 12:56 AM
08-14-2023 12:59 AM
Hi Gerd,
thanks for the reply.
I try to answer you questions.
Which error do you get in the first run of your VI? There should be an error when the cDAQ doesn't respond immediatly!
There is no error at all. The VI is running continously and there is no error. The Input signal is displayed as it should and reread as it should
On your VI:
08-14-2023 01:01 AM
Hi Gerd,
this is quite weird, because that is exactly what I did...
It generated a new folder and inside was the VI.
I tried it again now. Maybe I should not have opened it in LV2021 again.
08-14-2023 01:23 AM - edited 08-14-2023 01:23 AM
Hallo Tim,
@Tim_Rothha wrote:
- Why do you call that PWM output VI in a loop as fast as possible?
- If I call it slower, then the PWM frequency will differ to much as it will have small stops, (that is my understanding)
- Why don't you apply a scale to your AI channel so you don't need to scale the reading afterwards?
- Because this VI will run on different PCs which and I thought that the scale configuartion might not transfer propperly
Right now your PWM task is set to "finite elements" with just 10 samples: which duty cycle values are you able to output with these settings?
You can define scales in software, so they are available on each computer…
Suggestion:
08-14-2023 01:30 AM
Hi Gerd,
okay I will have a look into defining scales in software. Thanks!
I am able to output 0 to 100% duty cycle with this.
As long as I first started a small task with NI MAX. Otherwise there will be no output.
Thanks for the suggestion. This looks cleaner.
Kind regards
Tim