LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help Implementing Ramp Function for Kikusui Electronic Load PLZ205W in LabVIEW

Solved!
Go to solution

Hi GerdW,

 

When I give all the needed data as array, the loop is finishing all the iterations and only it is passing the array with last ramp values.

0 Kudos
Message 21 of 30
(227 Views)

Array_Loop.JPG

Right click on that tunnel inside the red rectangle and choose Tunnel Mode->Indexing. Et voilà!

Rolf Kalbermatter
My Blog
Message 22 of 30
(216 Views)

Hi Varghese,

 


@Varghese89 wrote:

the loop is finishing all the iterations and only it is passing the array with lastvalues.


To put it in other words than Rolf: this is because YOU set the output tunnel to "last value" mode!

 

  • I recommend the "concatenating" mode instead of "indexing" as you want to concatenate all the ramps.
  • Why do you subtract a constant 0 from all values of the upper input array?
  • Why do you subtract the lower array inputs from constant 0?
  • Why don't you cleanup your block diagram?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 23 of 30
(212 Views)

FYI, if anyone posts code snippets that look like below, you can drag and drop them onto your block diagram, see this article about using code snipits: 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2PkCAI&l=en-US

 

 

Drag this image onto your block diagram:

snip (1).png

 

If dragging and dropping does not work download the image and drag the PNG onto the block diagram. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
Message 24 of 30
(198 Views)

Hi Jay,

 

Thank you for your help. This is working for both ramp up and ramp down. I also need constant ramp with zero ramp rate. 

0 Kudos
Message 25 of 30
(181 Views)

Hi GerdW,

 

I sincerely thank you for your valuable help. concatenating served the purpose. I have also cleaned up the block diagram. 

0 Kudos
Message 26 of 30
(175 Views)

Hi Varghese,

 


@Varghese89 wrote:

This is working for both ramp up and ramp down. I also need constant ramp with zero ramp rate. 


A "constant" ramp uses a step width of 0 (aka "zero ramp rate").

Hint: You can define a ramp also by start, end and number of steps…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 30
(159 Views)

Hi GerdW,

 

Thank you for the hint. For a constant ramp, the start and stop values will be same and Yes, I was to specify the array size for which the value is constant. Currently I am checking the number of iterations based on the Quotient obtained from subtracting the difference of start and stop value with ramp rate plus 1. I am confused how to implement the constant ramp. I understand i need to check if the difference is zero and to input the number of iterations, but I am confused how to implement it, can you please elaborate. 

0 Kudos
Message 28 of 30
(153 Views)
Solution
Accepted by topic author Varghese89

Hi Varghese,

 


@Varghese89 wrote:

I am confused how to implement it,


Simple approach:

 

IF step_width == 0 THEN
  RAMP(start, end, number of samples)
ELSE
  RAMP(start, end, step_width)
ENDIF

 

A simple case structure and two different ways to create the ramp will solve the problem!

(You can reduce the problem to two ways to create the ramp parameters, then you call a generic Ramp(start, end, number of samples, step_width) function.)

 

"Programming" means to develop algorithms (independently from the language you use).

Often it helps to "divide and conquer"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 30
(137 Views)

Thank you so much :'). Case structure solved the problem.

 

Best Regards,

Varghese

0 Kudos
Message 30 of 30
(128 Views)