LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Altering attached code and bug-fix

Solved!
Go to solution

In the VI I have attached, there are two issues that my research supervisor and I would like to address, but are not familliar enough with the code to be able to alter it compitently, nor are we familar enough with LabView to code it from scratch.

 

The first issue is, the incrimentation system runs on Start Voltage, End Voltage, Incriment, and Time of incriment.

 

Ex. Start Voltage = 0.00

      End Voltage  = 5.00

      Incriment      = 0.01

Time to incriment= 1.00s

 

This will result in 500 incriments, each incriment taking 1 seconds, for a total run time of 500 seconds. We, however, are not actually using voltages, but are instead using this incrimentation system as a way to instruct the program on how many data points to take and for how long.

 

This is not our doing, but simply how the program was originally created (my supervisor received the code elsewhere and does not have contact with those whom from he received it). We would prefer the code to simple run on a For loop or a While loop so that we may run it for as long as we want it to run without using a voltage incrimentation system (because the voltage system does not allow a value for End Voltage higher than 10v regardless of the lack of actual voltages being applied.) If anyone has some idea of how this could be done, advice would be wonderful. 

 

 

The second issue is a small bug that occurs whenever data is being taken. Whenever chart 1 receives a data point, the first data point that it receives in any given data collection period is copied onto the other 3 charts. This should not be the case, as the other 3 charts are not representations of the data that should be coming from the first chart, and come from different sources entirely. I examined the block diagram, however I am a novice when it comes to LabView and could find no explanation.

 

If anyone has any insight regarding either of these issues with the VI I have attached below, assistance would be greatly appreciated.

0 Kudos
Message 1 of 11
(3,818 Views)

Your attached vi is missing an LLB it needs. 

The vi itself seems pretty basic but I'm not sure how to make it work without having those dependencies and probably a little bit more info of how your experiments work.

 

Depending on the maturity of the instrument control vis in that LLB, I think you may be better off starting from scratch.

0 Kudos
Message 2 of 11
(3,804 Views)

Hi,

 

Like Taki1999 mentioned, the missing llbs are needed to get down to some details.

 

I like to clean up messy vis so attached is your vi after *some* rearranging.

The attached vi should work the same as your current one (unless I mucked it up), but will give you a fighting chance to understand what is happening.

 

I suggest you take a look at it and try to understand the different parts.

Run it and place probes on the wires to get a feel for the operation.

Ask questions.

 

Issues:

One of the missing files "SR 245.vi" does not appear to do anything (has inputs, but no used outputs).

Unusual count delay code.

 

I hope this helps,

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 3 of 11
(3,783 Views)

I would simply use a fp control for the number of tests to run, rather than using incrementation as you have described.  I suspect these fp controls (start/end/increment started as as something else, and for ease of modification they kept the same controls, which now have different functionality.

 

Your end count will simply be 0.  Your start count will be whatever you set the numeric to.  Your "incrementation" will then be a counter decrement (or increment depending on which way you want to go).  I don't see how your other graphs are being updated at the same time as chart 1.  Which one is Chart 1?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 11
(3,765 Views)

Wow. Such a mess turned into such an organized setup. xD

 

First I want to say thank you.

 

As for the necessity of SR 245.vi, I really don't know (I didn't write the program and I'm really new to this so I have very little knowledge or reliable intuition regarding coding). I'll mess with it and see what happens xD.

 

It indeed seems to work as intended, the only question I have is, is there anyway to replace the external Voltage system with something more simple like a while loop or a for loop to iterate? 

0 Kudos
Message 5 of 11
(3,757 Views)

Chart 1 is labelled "Idler vs Voltage", and I'm not sure why the bug happens, only that whenever we took data, it messed up the scale of our graphs each time.

 

How would the system that you suggest be implimented?

0 Kudos
Message 6 of 11
(3,755 Views)

@ResearchStudentM wrote:
 

It indeed seems to work as intended, the only question I have is, is there anyway to replace the external Voltage system with something more simple like a while loop or a for loop to iterate? 


Absolutely.  If the external voltage is not needed, omit or disable these VI's from the system and replace it's output with a numberic control on the fp.  Other sections will need to be modified as well such as the incremental control (not needed).  Any logic or decision making done here can be replaced with your own based on the numeric setting on the fp.  You can inc/dec as much as you want by setting the properties of the control as well as setting a high and low limit.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 11
(3,735 Views)
Solution
Accepted by ResearchStudentM

Thank you Stevem181 and MoReese. Your advice was invaluable 🙂

 

The code now runs exactly as I would like it to run, and is cleaner and easy to navigate. Thank you both 🙂

0 Kudos
Message 8 of 11
(3,725 Views)

You marked your last post as the solution.  If you found something else than what was suggested, that's fine, but please post what you did; otherwise, mark the correct post as the solution.  Glad to hear your working.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 9 of 11
(3,717 Views)

The solution came from 2 posts, and since I can't mark both posts, I gave credit to you both in my post and marked it as the answer. Little else to be done.

0 Kudos
Message 10 of 11
(3,710 Views)