LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA programming

hello sir,

can anyone suggest me how to do my logic in labview.

i want to read the DO channels whichever goes high and corresponding analog value is to be noted from the FPGA reference ,

both the DO channel nos and corresponding pressure (analog input) value is to be write in a file when save button is pressed.

screen shots are attached below.

Digital outputs are Load-1,2,3,4,5 solenoids and AI is pressure.

Download All
0 Kudos
Message 1 of 10
(3,620 Views)

Hi uma,

 

I guess those images are taken from the RT part of your RIO project…

 

i want to read the DO channels whichever goes high

How do you read DO (= output) channels? Usually you only write to DO channels…

Why don't you use the wire going into the "FPGA write control" node? Here you know the current (requested) state of the DO channels! (You don't need to read and write the very same FPGA control in the same iteration of the loop!)

 

To detect rising edges in boolean signals you usually compare current state with previous one:

rising edge := current AND NOT(previous)
or when you aren't used to boolean logic:
rising edge := current > previous

 

corresponding pressure (analog input)

Which one is a "corresponding pressure" when there is only one AI channel used?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,601 Views)

Dear GerdW,

re:

corresponding pressure (analog input)

Which one is a "corresponding pressure" when there is only one AI channel used?

in that one AI channel(pressure),

if different load solenoid is on ,different pressure will be indicated in the real time.

for eg,

if i switch on(solenoid) load-1,2 - pressure will be 80 bar,

if i switch on (solenoid)load 1,2,3 - pressure will be 60 bar ,

if i switch on load 1 -5 (solenoids)(all) - pressure indicated will be 10 bar( minimal).

so i want to save which ever solenoid (DO) is on when particular pressure value is indicated in the analog input . 

0 Kudos
Message 3 of 10
(3,582 Views)

iam trying the same in event structure such that when save button is pressed the DO,s on and AI value should be saved.

0 Kudos
Message 4 of 10
(3,577 Views)

Dear GerdW,

Re:

 want to read the DO channels whichever goes high

How do you read DO (= output) channels? Usually you only write to DO channels…

sorry i mean it wrongly in words .

we can only write to analog or digital outputs and read from analog or digital inputs.

what i exactly tried to communicate in those lines are, i want to know or read the status of the DO boolean (i.e. load solenoids) whichever is selected and i want to save the channel numbers of the DO whichever is on.

0 Kudos
Message 5 of 10
(3,570 Views)

Hi uma,

 

so i want to save which ever solenoid (DO) is on when particular pressure value is indicated in the analog input . 

Make your VI run continuously by having a loop set to iterate at a certain rate!

Save the current state of the DO channels and the currently measured pressure value into a file.

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,559 Views)

Dear GerdW,

i am trying to do the same what you have suggested and let you know once it is done.

thanks for your reply.

0 Kudos
Message 7 of 10
(3,548 Views)

Hello GerdW,

i have done the logic as you suggested and hope it will work ,after deploying the code i will let u know how it works!

iam attaching the screenshot of it.

0 Kudos
Message 8 of 10
(3,454 Views)

Hi uma,

 

do you need to initialize the filepath in the FGV with each button press again?

As the path seems to be constant it should be enough to init just once…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(3,446 Views)

Hi gerdW,

 

iam using the FGV as a subvi in main VI and i think the path to be initialized .Smiley Happy

if any error comes while deploying i will let you know.thanks for your reply.

 

 

 

0 Kudos
Message 10 of 10
(3,437 Views)