LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-initializing my array with reset button

Solved!
Go to solution

@Jarrold wrote:

Once again, your help is much appreciated! 

 

I have no ways of thanking you, but still, I want you to know you've really helped me in many ways !

 

Regards,

Jarrold

 


Yes, you DO!  See that "Kudos" Button?  Go ahead and press itSmiley Very Happy


"Should be" isn't "Is" -Jay
Message 31 of 93
(1,285 Views)

Thanks dude. I finally understand how to do it. I got it.

 

Cheers !

Jarrold

0 Kudos
Message 32 of 93
(1,276 Views)

@cbutcher wrote:

Hey,

 

I can't use LabVIEW right now so I can't check your VIs but hopefully you found the solution.

 

Another way to add a refnum control that can be useful when you need more specific property nodes is to create the reference to the control in the main VI and then drag it onto the front panel of the SubVI. You can also drag it to the block diagram but then it drops a constant - you'd need to right click it and choose Change to Control to get a control then.

 

As jwscs already wrote, you should then add the front panel control to the connector pane and wire the reference in the main VI into the connection on the SubVI's icon.


Now that I have managed to do the real time update of my indicator, I have another similar problem just that it is a little different.

 

This time, I observed that my wavechart does not receive real time updates as well. However, this information is from the "DAQ Assistant". I do not really have an idea how to implement the same technique. Kindly advice me please 🙂

 

Regards,

Jarrold

0 Kudos
Message 33 of 93
(1,271 Views)
@Jarrold wrote:
Now that I have managed to do the real time update of my indicator, I have another similar problem just that it is a little different.This time, I observed that my wavechart does not receive real time updates as well. However, this information is from the "DAQ Assistant". I do not really have an idea how to implement the same technique.

Can you clarify what you mean? It looks like your DAQ Assistant node should update the chart each time it iterates, which I think should be 50 samples at a time every 20ms. Do you mean that when you reset your measurements, the chart continues with old data, or do you mean that the chart isn't receiving data properly?


GCentral
0 Kudos
Message 34 of 93
(1,266 Views)

@cbutcher wrote:
@Jarrold wrote:
Now that I have managed to do the real time update of my indicator, I have another similar problem just that it is a little different.This time, I observed that my wavechart does not receive real time updates as well. However, this information is from the "DAQ Assistant". I do not really have an idea how to implement the same technique.

Can you clarify what you mean? It looks like your DAQ Assistant node should update the chart each time it iterates, which I think should be 50 samples at a time every 20ms. Do you mean that when you reset your measurements, the chart continues with old data, or do you mean that the chart isn't receiving data properly?


Hey cbutcher,

 

What I mean is that the wavechart is suppose to have data coming in constantly, but now it only update once after the timer ends.

Here is the latest VI. Should be a lot alot neater Smiley Very Happy

0 Kudos
Message 35 of 93
(1,263 Views)

@cbutcher wrote:
@Jarrold wrote:
Now that I have managed to do the real time update of my indicator, I have another similar problem just that it is a little different.This time, I observed that my wavechart does not receive real time updates as well. However, this information is from the "DAQ Assistant". I do not really have an idea how to implement the same technique.

Can you clarify what you mean? It looks like your DAQ Assistant node should update the chart each time it iterates, which I think should be 50 samples at a time every 20ms. Do you mean that when you reset your measurements, the chart continues with old data, or do you mean that the chart isn't receiving data properly?


Hey cbutcher,

 

I actually solved the issue. Simply put the DAQ assistant inside my SUBvi and just run the whole SubVI instead of splitting it up into only clockSubVI and connecting it to the DAQ assistant outside.

I actually feel like I am better at Labview already and it's all thanks to you man.

 

Attached is the solution 🙂 

0 Kudos
Message 36 of 93
(1,257 Views)

I can't see what might be the cause for that - perhaps (although I'm doubtful) there's some issue in your ClockVI.vi. If you upload that VI, I can take a look.

 

Failing that, your graph does not have auto-scaling enabled for the X-axis. Is it possible that the scale just doesn't show the full range?

 

As an additional comment, outside of your case structure you have a Build Cluster Array node creating your Load.cluster, but this has no data dependency with the arrays of references. This creates a 'race condition' which essentially means that there is no guarantee that your arrays contain values when you create the cluster. As a result, when you use the result, it might not contain references.

 

Solutions to this are a Flat Sequence Structure (generally best avoided) or alternatively, and much simpler in this case, wire the hidden array indicator wires directly into the Build Cluster Array node. You can then wire the cluster directly into a shift register if you want (it doesn't currently look like you're using the cluster? Maybe I just missed a local variable).


GCentral
0 Kudos
Message 37 of 93
(1,256 Views)

@cbutcher wrote:

I can't see what might be the cause for that - perhaps (although I'm doubtful) there's some issue in your ClockVI.vi. If you upload that VI, I can take a look.

 

Failing that, your graph does not have auto-scaling enabled for the X-axis. Is it possible that the scale just doesn't show the full range?

 

As an additional comment, outside of your case structure you have a Build Cluster Array node creating your Load.cluster, but this has no data dependency with the arrays of references. This creates a 'race condition' which essentially means that there is no guarantee that your arrays contain values when you create the cluster. As a result, when you use the result, it might not contain references.

 

Solutions to this are a Flat Sequence Structure (generally best avoided) or alternatively, and much simpler in this case, wire the hidden array indicator wires directly into the Build Cluster Array node. You can then wire the cluster directly into a shift register if you want (it doesn't currently look like you're using the cluster? Maybe I just missed a local variable).


Oh **bleep**. I had already overwritten the old ClockVI. But is is very similar to the one i upload previously just that it does not consist of the DAQ Assistant and anything after that. 

With regards to the "No autoscaling", it is fine because I know the range of my results and it is will within the range. Just that data only comes in once after time elapsed. 

 

Thanks for your prompt replies ! 🙂

0 Kudos
Message 38 of 93
(1,254 Views)

@cbutcher wrote:

I can't see what might be the cause for that - perhaps (although I'm doubtful) there's some issue in your ClockVI.vi. If you upload that VI, I can take a look.

 

Failing that, your graph does not have auto-scaling enabled for the X-axis. Is it possible that the scale just doesn't show the full range?

 

As an additional comment, outside of your case structure you have a Build Cluster Array node creating your Load.cluster, but this has no data dependency with the arrays of references. This creates a 'race condition' which essentially means that there is no guarantee that your arrays contain values when you create the cluster. As a result, when you use the result, it might not contain references.

 

Solutions to this are a Flat Sequence Structure (generally best avoided) or alternatively, and much simpler in this case, wire the hidden array indicator wires directly into the Build Cluster Array node. You can then wire the cluster directly into a shift register if you want (it doesn't currently look like you're using the cluster? Maybe I just missed a local variable).


Hi there, cbutcher !

 

I have encountered another problem and I am not really sure where is the problem this time. 

When I am drawing data from my controller through Modbus Protocol, I wish to have a real time update of my wavechart.

 

However, my wavechart is updated only once after each time my timer is up. I have created a reference and connected it up similar to the previous solution provided about but it does not work this time. Attached is my latest VI. Do take a look and advice me where could the possible problem lie.

0 Kudos
Message 39 of 93
(1,241 Views)

Aha! So I was trying to look through your wires regarding the problem you're describing - I'm guessing you're now talking about the "Logging Volt" case and the DBL Graphs?

 

I noticed (can't believe I didn't look closely earlier!) that you have a large number of charts all overlapping one another. You definitely don't need to do this! I was trying to work out how to read around all of the many wires you have connected to "ModBus Data VI.vi" (side note - generally people try to avoid having more than the 5-3-3-5 connector pane as it becomes very hard to work out what's going on once you have so many wires. 4-2-2-4 is the good default! 🙂 ) and I noticed your Control Panel radio button controls which chart to display.

 

All you need to do here is plot ALL of the data to one Waveform Chart, and then adjust which plot is visible (assuming you only want one visible at a time). You can also adjust the label or caption of the Chart if you want to have it display like it does now, with a label describing what is being plotted.

 

This will allow you to output only one wire with all of the data from the ModBus Data VI.vi which will be another leap forward for your VI (again, congrats on progressive improvements - it all fits on one monitor nicely now. Just the overlapping that really still hurts!!).

 

The relevant section of the Detailed Help that you would want to create a multi-plot Waveform Chart is pasted below. I have made some parts bold - I'm not certain if you get equally spaced data for each wire at present:

 

To pass data for multiple plots to a waveform chart, you can bundle the data together into a cluster of scalar numeric values, where each numeric represents a single point for each of the plots.

If you want to pass multiple points per plot in a single update, wire an array of clusters of numeric values to the chart. Each numeric represents a single y value point for each of the plots.

You can use the waveform data type to create multiple plots on a waveform chart. Use the Build Waveform function to plot time on the x-axis of the chart and automatically use the correct interval between markers on the x-scale of the chart. A 1D array of waveforms that each specify t0 and a single-element Y array is useful for plotting data that is not evenly sampled because each data point has its own time stamp.

If you cannot determine the number of plots you want to display until run time, or you want to pass multiple points for multiple plots in a single update, wire a 2D array of numeric values or waveforms to the chart. By default, the waveform chart treats each column in the array as a single plot. Wire a 2D array data type to the chart, right-click the chart, and select Transpose Array from the shortcut menu to treat each row in the array as a single plot.

 

This lists all of the ways to plot multiple plots in one chart.

To select which is visible, use the property nodes:

visible.png

 

Here you choose the plot index and wire it to ActPlot, then the boolean for Visible. You could consider using a For loop and an Equals node, along with your control loop, if you wire the data in the appropriate order. You'd need to also wire the iteration count, this should be a constant equal to the number of plots you have.

 

loopVis.png

 

To address your actual question, I can't see why the charts wouldn't be updated each time the ModBus VI finishes, but maybe that's what you see and you meant you wanted something else?

 

Perhaps you can upload the ModBus VI (preferably after reducing the number of inputs and outputs!) and we could take a look at that?


GCentral
0 Kudos
Message 40 of 93
(1,233 Views)