LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NEED CHART WITH 1-MINUTE TIME X AXIS

Your code still needs a lot of work and I am sure once the code is cleaned up and the recommendations of other followed, things will fall into place.

 

  • You still have several diagram constants that are DBL, causing all these coercion dots and elevating all data structures to DBL.
  • Why is the tab terminal inside the FOR loop? Pointless!
  • A one minute wait makes the UI unusable. It might take up to 2 minutes to react to e.g. the stop button.
  • Why can't you just reshape the 2D array to 1D and use a single FOR loop?
  • You probably want an empty case as default, just to be sure. (I doubt you even need a case structure!)
  • You still set the offset every 60 seconds instead of only once.

 

Can you run your VI until "RegisterValuesUI 2" contains data, stop the VI, make the current values of "RegisterValuesUI 2" default, save under a new name and attach it here. This gives us something to play with.

0 Kudos
Message 11 of 18
(502 Views)

Thank you so much for your help it means a lot to me because I am still new in LabVIEW. 

 

  • You still have several diagram constants that are DBL, causing all these coercion dots and elevating all data structures to DBL.

I dont understand what that means, which one diagram constants?

 

 

  • Why is the tab terminal inside the FOR loop? Pointless!

While correcting the program, I put it accidentally  inside FOR loop.

 

 

  • A one minute wait makes the UI unusable. It might take up to 2 minutes to react to e.g. the stop button.

I read somewhere on forum that Wait function need to be the same as offset, so I put it.

 

 

  • Why can't you just reshape the 2D array to 1D and use a single FOR loop?

I have 8 inverters (from 2 different producers) in my PV system. All of them have different IDs and IP addresses, so I need make initialization for each separately. The rows show one inverter so I use 2 for loops during loging data; First one for choosing inverter and the second one for reading each measurements individually. 

 

  • You probably want an empty case as default, just to be sure. (I doubt you even need a case structure!)

I need case structure because of reasons mentioned above (different inverters - different IDs and IPs) and some data should be scalared with different values. if you have a better and more efficient method to reduce the number of cases, I will appreciate your help. I will upload my Read1scada(subVI).vi and InverterInit (SubVI).v

 

  • You still set the offset every 60 seconds instead of only once.

Sorry, my fault.

 

Tomorrow I will run the program in the lab and send the desired .vi with data.

 

Thanks again and I accpet all sugesstions and help from you and others experts. 🙂

 

 

 

 

 

0 Kudos
Message 12 of 18
(495 Views)

Hi,

upload as you say, the current values of "RegisterValuesUI 2".

 

Thanks!

0 Kudos
Message 13 of 18
(467 Views)

Sorry, this is way too messy to do any reasonable work on my 1080p laptop screen. Why is the front panel set to a minimum width of almost 3k pixels and a gigantic height? I can't even bring the bottom scrollbar into view!! Why is there so much code duplication? (e.g. that swarm of property nodes near the top could be replaced by one, iterating on an array of references. You still have all these coercion dots. You still have all these local variables. Why are there so many overlapping front panel elements?).

 

0 Kudos
Message 14 of 18
(456 Views)

Hi mojmalije,

 


@altenbach wrote:

Sorry, this is way too messy to do any reasonable work…


Yes, it is!

 

Example before:

 

and after:

Is your coding style considered "readable"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 15 of 18
(450 Views)

I am so so sorry, because I uploaded my old application accidentally. This one is my new and now it works correctly, but I want to make my program more efficient and reliable.

0 Kudos
Message 16 of 18
(432 Views)

Hi Mojmalije,

 


@Mojmalije1. wrote:

I want to make my program more efficient and reliable.


Several items:

  • don't use SGL indicators for DBL data (like "user 3" array indicator): avoid coercion dots, expecially on array data…
  • having a 20s wait in the main loop will make your program very unresponsive to user actions: use a shorter wait!
  • use reasonable datatypes: why does your Inverter configuration cluster store unit IDs as DBL value when you need tham as U8 datatype?
  • do you really need an array fo error clusters? Why not use a scalar error cluster in the Read1Scada subVI? You also should check all shift registers: some are NOT initialized…
  • I would avoid local variables, like in state 28/29 of your large case structure.
  • Don't hide control labels in the block diagram: hidden labels reduce code readability!
  • I would hide the labels of subVIs/functions to improve code readability: use the context help window to learn subVI/function names!
  • use diagram sublabels to provide code comments!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 18
(420 Views)

Thank you so so much for this comments, they are really helpful!!! I accept all of them, but I have 2 questions.

 

  • having a 20s wait in the main loop will make your program very unresponsive to user actions: use a shorter wait!
    • When I put shorther or different time in the main loop then time for the Multiplier on Property Nodes for chart, then my chart show data  faster then real time. For example, if it is now 11:22h, on my chart it shows data for 11:37h.
  • I would avoid local variables, like in state 28/29 of your large case structure.
    • What alternative I can use?

Thanks a lot, I really learn a lot with your advice!

0 Kudos
Message 18 of 18
(403 Views)