From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate .lvsc using external application

Hi,

 

I don't think that it is possible, but I want your confirmation.

 

I'm currently working with the statechart module and I want to generate a statechart with a configuration file or other external way.

 

From my research, I think that it is only possible to send and receive data from LabVIEW, but I want to know for sure if there is a way to generate a .vi or a .lvsc without using the LabVIEW application.

 

Thanks

0 Kudos
Message 1 of 3
(2,153 Views)

I've managed to do this definition in Simulink, with this script:

 

sfnew
rt = sfroot
m = rt.find('-isa','Simulink.BlockDiagram')
ch = m.find('-isa','Stateflow.Chart')

sA = Stateflow.State(ch);
sA.Name = 'A';
sA.Position = [50 50 310 200];
sA1 = Stateflow.State(ch);
sA1.Name = 'A1';
sA1.Position = [80 120 90 60];
sA2 = Stateflow.State(ch);
sA2.Name = 'A2';
sA2.Position = [240 120 90 60];
tA1A2 = Stateflow.Transition(ch);
tA1A2.Source = sA1;
tA1A2.Destination = sA2;
tA1A2.SourceOClock = 3;
tA1A2.DestinationOClock = 9;
tA1A2.LabelPosition = [180 140 0 0];
tA1A2.LabelString = 'E1';
pos = tA1A2.LabelPosition;
pos(1) = pos(1)+5;
tA1A2.LabelPosition = pos;

% Add a default transition to state A
dtA = Stateflow.Transition(ch);
dtA.Destination = sA;
dtA.DestinationOClock = 0;
xsource = sA.Position(1)+sA.Position(3)/2;
ysource = sA.Position(2)-30;
dtA.SourceEndPoint = [xsource ysource];
dtA.MidPoint = [xsource ysource+15];
% Add a default transition to state A1
dtA1 = Stateflow.Transition(ch);
dtA1.Destination = sA1;
dtA1.DestinationOClock = 0;
xsource = sA1.Position(1)+sA1.Position(3)/2;
ysource = sA1.Position(2)-30;
dtA1.SourceEndPoint = [xsource ysource];
dtA1.MidPoint = [xsource ysource+15];

sfsave(m.Name, 'myModel');

 

It's this behavior that I want to know if LabVIEW supports.

0 Kudos
Message 2 of 3
(2,127 Views)

Hello,

 

I am not sure about the understanding of your issue.

 

You want to know if you can generate a .vi or a .lvsc without LabVIEW (but LabVIEW is installed on your computer).?

 

What is the purpose of your request? We may be able to find another way around your main need.

 

I am convinced that genrating or creating a .vi without LabVIEW is not possible. You can generate a VI with Vision assist or DAQ assist, but it will be specific with vision or a daq application.

 

I found a link but I am pretty sure it will not answer your question. You will find it below if necessary.

Using LabVIEW Statecharts Without the LabVIEW Statechart Module Installed

http://digital.ni.com/public.nsf/allkb/9DB6848A55B926458625732900505358?OpenDocument

 

Dont' hesitate to answer with more information,

 

Regards

 

 

 

0 Kudos
Message 3 of 3
(2,106 Views)