LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update file name

Nishant,

Have a look at the latest attachment.

I left one of the created files in there.  Code is messy (sorry), and the time/date needs to be seperated..

But it illustrates how to do what you want to do.

The other thing that was not done is the "reset file numbering" scheme..

--- no time today -- sorry..

Let me know how it goes.

Ray

Message 51 of 94
(2,070 Views)

Hiii, Ray

            First you let me know that, what is CVI? i havent understand that what is CVI? from past six months and you please explain me something about that...Smiley Indifferent.

          I will check the solution for the "higher vis", and yes you were absolutely right in the concept of using the while loop, when i had use that program in the project, my project's whole control goes to that vi, with the while loop, so niw i have to solve it, can you please tell me any solution for that, bcoz i want data continuosly, uptil trigger is on and in between i ve to put the trigger, for checking that the file shouldn't overload.

Thanks,

Nishant

Message 52 of 94
(2,063 Views)
Hiii, Ray
 
            I am sorry to say but i can't ustand ur program, wy u ve make the case structure of error in ? and in the datalogging.vi, why u ve use the reference and another as u ve use the while loop, control goes into it continuosly, so its a same problem as you told me, so is there any option to sort out that, to stop the whle loop in betn, that is the main option... coz it is not stopping
 
Thanks,
Nishant
Message 53 of 94
(2,062 Views)


Hi Nishant,

Sorry about the last post..  I squeezed a few minutes to prepare the vi's and had to get back to work..  😉

CVI:  LabWindows-CVI, it is an ANSI-C type language from NI.  Nice development environment.  You can look at the forum just below the LabView one.

I appologize for not describing what the example does (and remember that it is incomplete).

1.  The "higher-level.vi" represents the main routine.  It calls a vi called initialize (which should be replaced by your own instrument initialization vi) and enters a while loop that contains a case statement which will create a new file with header the first time it is run and a new file everytime the max. size is reached.  The Case Statement also contains a vi called "data-logging", which simulates your data logging (it should also be replaced by your own vi for data logging).  The data logging example simply fills a file with lines of a date followed by the numbers 0 to 48. This "higher-level.vi" can be stopped by pressing the stop button. The same stop button should also stop the inner loop... which stops based on 2 conditions: stop button is pressed or max file size reached.

2.  Before running the vi, you should either enter a valid (existing) file path inside the "path" control or select Option "Run-time Selection".  You could flip the switch before pressing OK in the initialization window.  Also the leading filename & extention control boxes should have the appropriate info.

3. The trigger for data logging, do you want the ability to turn ON & OFF datalogging outside the control of the main loop?  Maybe that is what I had not understood.  If so, this actually simplifies things.. 

4.  The Error Case is actually a standard approach to avoid running a vi (or sub-vi) if a previous error occurred.  It avoids doing unwanted actions.  If there are no errors, then it behaves as if there were no case statements 😉

5.  The references are a cleaner way to do coding by passing a value to a sub-vi.  The value is shared at the same time to all vi's using the referenced value.  But you are right... I must have done something wrong with the boolean reference.  I will look into it as soon as I get a chance (not sure today).  The idea was to illustrate how it is done.  However, if item 3 above applies, then the trigger method to start & stop datalogging would have to be different.  However, I would like to place the control on the main vi's Front Panel, hence the use of reference (action from the main vi goes into the sub-vi without having the execution return to the main vi)  🙂

I can modify the vi to place a "max file size" control.

Have a good weekend,

Ray

Message 54 of 94
(2,060 Views)

Hiii, Ray

         Is CVI a programming language? or somethin else? coz i would love to program the things on language bases instead of GUI bases (LabVIEW), so i am interested if it is a language based and it also overcomes the limitations. i will read the description and hope that it will help me for sure.

Thanks,

Nishant

Message 55 of 94
(2,052 Views)

Hi Nishant,

Go to this link for a description of CVI:    http://www.ni.com/lwcvi/

It is ... well...  a C / C++ (look alike) programming language.  I hesitate to use the term look alike or C++ for describing CVI.  It is based on ANSI - C. 

As for GUI (LV) versus textual (C / C++), it is a matter of personal choice and experience.  I much prefer LV because of how fast I can implement just about anything I would want to do in C / C++.  I still like working with C because I want to keep up the knowledge and continue to discover the things I have not done in C / C++..  😉

For instance, I would not do embedded or low level drivers in LV.  Not with LV-7.1.  But who knows... that may change in the future.

How is your program doing?

Ray

Message 56 of 94
(2,037 Views)

Hiii, Ray

      hii i am online reight now not from my office, but o/s at the cyber cafe... are you in the office? anyways thanks for the description of the CVI, and my project is on the way now, only because of you, owise i was hanged in that, thanks man. but here is one difficulty, there is no job openings in the india, and which is inspiring me to left the LVSmiley Sad, so it is somewhat difficult already, and another thing i am not getting much payment in the company right now, and that could be the second reason.

if you can reply, reply me right now

Thanks

Nishant

 

Message 57 of 94
(2,035 Views)

Hi Nishant,

I'm sorry to hear that.  But "hang in there".  I am sure you'll get more & more work. 

In the meantime, explore the tolls offered with LV by implementing various things.  That way, you'll familiarize yourself with the tool, further.

🙂

Message 58 of 94
(2,030 Views)

Hiii, Ray

              Thanks and sorry for the late reply on this but i was working on the another module for the 2-3 days, and today get back to this finally, i had take a look on this and its good concept actually, now i want to ask that is it really necessary to initialise a inst's vi here, coz it is already been initialised in the top-most vi, Stop button is also not working accordingly, it is not stoping the action either and yes u r right about the 3 rd point, i exactly want the method like triggering mean suppose, trigger, is on datalogging-should be On and if it is being off then it should stop the data-logging,but here wat happens, that whenever stop button is pressd(i mean when vi gets stop command),then at the time it will create another file instead of stoping or writing the Data-Logging, which shouldn't happen, and if possible, please modify the vi today, coz weekends are near now, and i m in somewhat in hurry, not getting any good stuff for file writing by any of the efforts, i ve tried our firsdt method in the past but as i told you, it was hanging in the while loop, thats why...

Thanks,

Nishant

Message 59 of 94
(2,020 Views)

Hiii, Ray

             Let me explain you something in detail, actually thing is i want to write the data in the excel file, whenever trigger comes, but it should be done in parallel with the other events, now the vi what u ve give me about writing the data into the file with the incrementing the header but whenever i was calling that vi, it was hanging in the while loop, and all other vis stop working, which i dont want, and thats why i am looking for the write file vi, which shouldn't have the while loop, but whenever i ve tried to write the data without while loop, it was difficult to do, and that is harassing me form past 1-1.5 months( the root of whole problem is while loop), and the new files u ve provide, also have the same problem, so please suggest me something different( "jara hatke"Smiley Wink) form the while loop.

Thanks,

Nishant

Message 60 of 94
(2,019 Views)