Jump to content

System clock, wait function, merging VI's


Recommended Posts

I am having trouble with this one task: wait function with system clock

"Create a new VI and place the sine wave subvi in a while loop delayed by a wait function that is syncronizable to the system clock. The loop is to be updated with a control that works in units of seconds"? Range being 0-10, an increment being 0.05 seconds. WTF?! On the example final panel there is a Update(s) Control button that says 0.05. So, I guess you can change the updates in multiples of 0.01 seconds? How do I get all the stuff on my display panel on the sub-vi to show up on the the final display panel...or vice versa....

Link to comment

Posting an example will help here....

But if I understand you (?) then to pass data to and from subVIs you will have to wire up the connector pane of the icon to enable passing data to and from a top level VI.

Also the System Clock on a desktop OS has a 1ms resolution.

Link to comment

QUOTE (MicrochipHo @ May 20 2008, 10:43 AM)

Here's an example

What's HH alert? Anyway, This is what I am planning to do for context: I believe instead of the loop interations i have in the original sub vi. i will use the times that the whole loop incremented at whatever the user chooses, and the sine curve will be updated with that when the person chooses refresh.

Then a sub vi is needed (it must be created) to calculate the rms value.

Here are the quotes:

Create a new vi and place the sine wave sub vi in a while loop delayed by a wait function that is synchronizable to the system clock. The loop is updated witha control in the units seconds. Place a momentary button named refresh that updates the display and writes the control values to the wave sin generator. Boolean controls to view the three awways shoul also be on the front panel. Place an error handler in the code to notify the user that a maximum voltage of 10 Vpp.

Create a subvi that acquires 1 cycle of the generated data and calculates the rms value.

save it in a wired and password protected version.

i think i may have overdone the connector panes. Is it worth having a subvi at all?

By the way you need to include all subVIs if you post a top level vi (try a zip file).

I don't think the above is too hard to do and I won't be doing you homework assignment for you, but subVIs are great to abstract code, create modular code, create reuseable code, make debugging easier, make the BD neater etc..

It would be a good idea to encapsulte the function generator in a subVI (whether you are required to write your own or use LV's).

Have a go at making it run, at this stage overkill on the connector panes shouldn't be a higher priority than getting it to work.

Remember to have fun!

Link to comment

i am gueessing that the subvi is not the way to do it, because you still want to extract some of the parts of the sub vi - the gain, all the calculations and etc, and be able to graph it. Because eventually you want on the front panel, the update button which will replace the times generated by the loops, and then replot the sine curve. I also see the considerable amount of downloads but no answer, has everyone else just given up on this? If anyone is actually dissecting it, let me know if you are or have given up. I asked other people ni the class and they used enumeration rings and truth structures. It may have been the way i created the sine wave program in the first place, and now I am thinkig that he menat just make it its own seperate sect of code so it isn't manglrd. Also, the assigment was to use a sub vi, so i i assumed that you take the sine wave vi and put it in another vi. It doesn't seem like it can complete its purpose that way.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.