annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

LabVIEW VI scripting - save generated VI

Risolto!
Vai alla soluzione

Is it possible to automatically save a generated VI (using LabVIEW VI scripting) under a specific target that is already added to the project?

 

0 Kudos
Messaggio 1 di 7
5.748Visualizzazioni

Yes. The easiest way to do this is to open the VI in the proper context. Both Open VI Ref and New VI have an application input. Use this with an application reference from your specific target to open the VI in the proper context. Then save normally.

 

One way to get the application reference is the following sequence:

  1. Application property: Project.ActiveProject
  2. Project property: Targets
  3. TargetItem property: Name (filter to find correct target)
  4. TargetItem property: Application

There is probably a faster way, but this will work.

Messaggio 2 di 7
5.714Visualizzazioni

It is still not clear to me how to do that from your answer. Could you add a photo of those steps?

 

 

 

0 Kudos
Messaggio 3 di 7
5.626Visualizzazioni
Soluzione
Accettato da chikenene

I think DFGray is trying to do something like this.  There is also an Invoke Method for the Target Item class to add a file.



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
Messaggio 4 di 7
5.606Visualizzazioni

I can't save my autogenerated VI...😓

Senkaki_0-1684773102374.png

Can I have some help please?

0 Kudos
Messaggio 5 di 7
2.610Visualizzazioni

@Senkaki wrote:

I can't save my autogenerated VI...😓

 

Can I have some help please?


I would suggest looking at the error you get, but I'm guessing that the error is that you probably need to give the full path to the VI and there's probably already a folder called Tarjetas on your desktop, so LV can't save a VI with that name.

 

Another potential issue is that you might need to create all of the folders in the hierarchy of the path (I didn't check) and there's an OpenG VI which does that (there's also a shipping VI, but that returns an error if the path already exists, so you have to filter for that error).


___________________
Try to take over the world!
Messaggio 6 di 7
2.581Visualizzazioni

Sorry for the late response.

 

For some reason, it wasn't saving the VI if I generate it from a VIT.

I chose to save a pattern VI, copy and paste it, and then modify it before the saving. This way, it doesn't give me any errors.

 

Regards,
JonA

0 Kudos
Messaggio 7 di 7
2.192Visualizzazioni