LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

code help

Im working on a program attached is the code. When i try running the ramp vi code it does not work. Can someone please look at the code and help me out on possible errors. Thanks

0 Kudos
Message 1 of 10
(3,546 Views)

@Mortiz_sac wrote:

Im working on a program attached is the code. When i try running the ramp vi code it does not work. Can someone please look at the code and help me out on possible errors. Thanks


 

Well, the code is a mess and you are not providing any details on what it should actually do.

 

In what way doesn't it work? What are typical inputs? What happens? What do you expect to happen?

0 Kudos
Message 2 of 10
(3,531 Views)

Sorry for not explaining.

 

The code is a program for a composite press machine. The purpose is to run the machine automatically. The first problem im trying to figure out is why the program code is not turning on the cartridge heaters. I'm using a Daq Ni 6009 to switch on and off 2 steady state relays for the top and bottom cartidege heaters. I ran the ramp vi to try and test the heaters by setting a temp and nothing happened, was i supposed to set the temps on the global vi first before running it? 

0 Kudos
Message 3 of 10
(3,515 Views)

How important is this to you?  The low quality DAQ isn't usually a good choice for control.

0 Kudos
Message 4 of 10
(3,477 Views)

This is what i have to work with at the moment, eventually we will be using something different. At this point im trying to figure out if there are errors on the code causing the the heaters to not turn on or if i really need to use a dfferent DAQ?

0 Kudos
Message 5 of 10
(3,471 Views)

1. Do the code activate the outputs? (check code state)

2. Do the outputs activate? (disconnect relays and measure directly, do you have pull up resistors?)

3. Is the power sufficient to activate the relays? (is the outputs dragged down when loaded?)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 10
(3,436 Views)

Most DAQ boards do not have enough current capacity to handle relays, even SSRs.  As was previously suggested, disconnect the digital lines from the relays and measure then directly.  That will tell you if your program is working correctly.  Then you can get some digital buffers that can handle the current needed to control your relays.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 10
(3,405 Views)

Let me try to help a bit.

 

Your code suffers from abuse of global and locals. For example: the  Start/Stop termial is unwired and the only two places you read the locals are in the same frame of one case statement! That sould prompt you to find other ways of removing the unneeded locals and globals!   It is difficult to see what the dataflow really is and the right to left wires do not help you at all in that respect!

 

Get rid of the DAQmx assistants and use the DAQmx API.  With a little peek at the Help file and the Example finder you might even find out the you can log to TDMS using "DAQmx Configure Logging.vi" and completely remove your logging loop and solve the remaining challenge of passing data between loops.

 

Post back with attempt #2 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 10
(3,388 Views)

Jeff·Þ·Bohrer wrote:

you might even find out the you can log to TDMS using "DAQmx Configure Logging.vi" and completely remove your logging loop and solve the remaining challenge of passing data between loops.


That functionality is also in the DAQ Assistant (there is a Logging tab).  But maybe I should take a look at the code before I make any real judgments.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 10
(3,374 Views)

@crossrulz wrote:

Jeff·Þ·Bohrer wrote:

you might even find out the you can log to TDMS using "DAQmx Configure Logging.vi" and completely remove your logging loop and solve the remaining challenge of passing data between loops.


That functionality is also in the DAQ Assistant (there is a Logging tab).  But maybe I should take a look at the code before I make any real judgments.


Go figgure! IDNKT Thanks for that!  (I'll still avoid the express vis in code though!)


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 10
(3,366 Views)