04-05-2022 10:03 AM
No matter what, you need to show us your code.
@Powerdou wrote:3, lots of global variables and local variables
You say that as if you are proud of it. 😄 Of course "lots of" is a very vague term, but I would translate it as "too many".
04-05-2022 11:17 AM
@altenbach wrote:
@Powerdou wrote:3, lots of global variables and local variables
You say that as if you are proud of it. 😄 Of course "lots of" is a very vague term, but I would translate it as "too many".
The phrase "one's too many and a thousand's not enough" comes to mind...
04-05-2022 08:42 PM - edited 04-05-2022 08:44 PM
thanks, here below are some updates for you all.
1, about front panel pixels, it is a tab control with 9 pages, and the size is 902*1800;
2, about my hard drive, it is local drive in my computer, it is SSD drive, and there is 195GB available on my drive.
3, about SCC setting, I have't set the SCC , they are all with default setting, please see the pic attached below.
4, about my computer, Dell inspiron 7500, with win10 family version, 16G RAM, during saving all files, CPU usage is about 16%, and RAM usage is about 1.33G.
5, about seperation code in enviroment , see pic attached below please.
6, about 200 cases, to be honest, I can not share the code, this is because I do not want to share my device communication protocol with public. but anyway, I can give some information on why I am using so many cases inside an event case structure. maybe there are other ways for me to do this but I do not know.
here below is what I am doing with my front panel.
I am using a tab control(with 9 pages) in front panel to communicate with my device.
there are many control buttons in each control tab page, each button is used for a unique command to read/write specific memory or execute a specific operation in my device. the total command quantity is about 200.
the front panel keeps reading a specific data(let's call this data A) from my device if there is no other command triggered or under execution.
once there is a button pressed, then this button related command is triggered and then being executed, after the complemetion of this command, then go back to keep reading data A again.
also, there are different execution time period for each command, like 100ms, 5s, 15mins(for a special calibration process).
there is no different priority requirement for each command in my communication protocol.
I can press the control button in front panel as many as I need, and the execution sequence is only based on the sequence of different button pressing.
7, about splitter, I am not sure if you are saying splitter bar, there is no spplitter bar in my front panel
8, about resize of control or indicator in my front panel after saving all file. actually, there are two issues about this, one is position change, and another is size change. after I completion of saving all files, the position of some controls and indicators changed, so I have to move them back to the right positions, then save again, it changed again, so finally, I have to use lock them in the panel to make them not moving after my saving.
about resizing, up to now, there are some boolen button in front panel resized(maybe 3 times bigger) after my saving.
9, about quantity of global variables, it is about 10. Just want to make it clear to you all.
thank you all for the help!
04-05-2022 09:15 PM - edited 04-05-2022 09:37 PM
Thank you for clearly answering most of the questions. And the screenshots! Reduce maximum steps for undo per vi to 20 or even 9
99 instances of a 5Mbyte vi is your problem!
Altebach is probably going to pull out his hair (he had the great Idea in the Idea exchange to change that number from default 9 to 99 BUT, he writes better code than you do!)
Really large vis or projects need some type of workflow control on top of source code control. You need to check out a library for a reason before you update the entire project ! You are doing something that does not scale well for the deliverables.
I know, those little tidbits of trivial knowledge were painful to learn for me too!
04-05-2022 10:00 PM
@Powerdou wrote:
6, about 200 cases, to be honest, I can not share the code, this is because I do not want to share my device communication protocol with public. but anyway, I can give some information on why I am using so many cases inside an event case structure. maybe there are other ways for me to do this but I do not know.
here below is what I am doing with my front panel.
I am using a tab control(with 9 pages) in front panel to communicate with my device.
there are many control buttons in each control tab page, each button is used for a unique command to read/write specific memory or execute a specific operation in my device. the total command quantity is about 200.
the front panel keeps reading a specific data(let's call this data A) from my device if there is no other command triggered or under execution.
once there is a button pressed, then this button related command is triggered and then being executed, after the complemetion of this command, then go back to keep reading data A again.
also, there are different execution time period for each command, like 100ms, 5s, 15mins(for a special calibration process).
there is no different priority requirement for each command in my communication protocol.
I can press the control button in front panel as many as I need, and the execution sequence is only based on the sequence of different button pressing.
Having so many dedicated buttons tend to indicate that you're not familiar with utilizing advanced controls such as lists or trees to populate a list of options that is scalable and even simplify/group commands based on the number of inputs and outputs this way your UI is simple and at the same time scalable where all the details of the options and their functionalities come from a configuration file.
04-05-2022 10:21 PM
To be hoest, I am only a beginner of the LV coding. I am not familiar with other advanced controls.
BTW, each case in my event case structure does not send only a protocol command to my device, there are different data processing codes included(according to the cmmand application) for each case , and after the completion of the data processing, then send a command code to my device based on the calculation result.
if there is only different command to be send for each case in my event case structure, I know there should be a simple way to achieve.
04-06-2022 03:16 AM
@JÞB wrote:
Thank you for clearly answering most of the questions. And the screenshots! Reduce maximum steps for undo per vi to 20 or even 9
99 instances of a 5Mbyte vi is your problem!
Altebach is probably going to pull out his hair (he had the great Idea in the Idea exchange to change that number from default 9 to 99 BUT, he writes better code than you do!)
But the undo stack (bkhp) isn't stored...
I don't see how it will effect the save time.
04-06-2022 03:33 AM
just an update
with changing the maximum undo steps per vi from 99 to 20 in environment, it doesn't help with save time issue.
04-06-2022 04:11 AM
@Powerdou wrote:6, about 200 cases, to be honest, I can not share the code, this is because I do not want to share my device communication protocol with public. but anyway, I can give some information on why I am using so many cases inside an event case structure. maybe there are other ways for me to do this but I do not know.
here below is what I am doing with my front panel.
I am using a tab control(with 9 pages) in front panel to communicate with my device.
there are many control buttons in each control tab page, each button is used for a unique command to read/write specific memory or execute a specific operation in my device. the total command quantity is about 200.
the front panel keeps reading a specific data(let's call this data A) from my device if there is no other command triggered or under execution.
once there is a button pressed, then this button related command is triggered and then being executed, after the complemetion of this command, then go back to keep reading data A again.
also, there are different execution time period for each command, like 100ms, 5s, 15mins(for a special calibration process).
there is no different priority requirement for each command in my communication protocol.
I can press the control button in front panel as many as I need, and the execution sequence is only based on the sequence of different button pressing.
Get all controls as an array. Get all buttons from it. Dynamically register for all value change events. Check the label of the reference to start a specific action.
Now you have 1 event for all buttons, and handling the action to be taken can be done in a sub VI.
If you have one event for each button, you probably have a lot of duplicate code as well..
You don't have to register dynamically, but you don't want to create a case for each control if you have 200 of them:
04-06-2022 04:21 AM
@Powerdou wrote:8, about resize of control or indicator in my front panel after saving all file. actually, there are two issues about this, one is position change, and another is size change. after I completion of saving all files, the position of some controls and indicators changed, so I have to move them back to the right positions, then save again, it changed again, so finally, I have to use lock them in the panel to make them not moving after my saving.
about resizing, up to now, there are some boolen button in front panel resized(maybe 3 times bigger) after my saving.
Are you sure this doesn't happen by a) your code or b) a manual move or resize of the front panel?
If a save really moves and resized controls, you're Vi is corrupt.