02-28-2020 10:51 PM - edited 02-28-2020 11:01 PM
Hi Mark
So what is your suggestion?
Imagine you want to monitor the variables and flags of your software code of Micro to verify its execution and you don't have any hardware platform to test the code and just Labview can help you 🙂
Thanks
02-28-2020 11:56 PM
Hi Laian,
When you read the values from VISA, are you getting them all as a single string?
Then you're parsing this string into the 300 variables (values, flags etc) and populating controls via local variable?
It's already been said several times that grouping your controls where possible will make your code much simpler to deal with.
It might also be useful to consider whether other string formatting tools and array/cluster manipulations can reduce the work processing the variables (e.g. Array to Spreadsheet String perhaps, or the Array to Cluster you mentioned).
Can you show your code? Or a demonstration with maybe ~10 controls and the same method, with a string saved as default for the input?
02-29-2020 12:37 AM - edited 02-29-2020 12:46 AM
Hi Cbutcher
this is my VI for just 4 bytes. Now I am trying to do it with cluster as I want to be able to move the control cells wherever I want on the control panel separately
Thanks
02-29-2020 02:05 AM
Hi GerdW
@GerdW wrote:
You don't need the ClusterToArray function to read/write data from/to a cluster. You need (Un)Bundle(ByName)…
how to connect VISA read buffer to cluster?
Thanks
02-29-2020 04:07 AM - edited 02-29-2020 04:35 AM
Hi all members
how to connect visa read buffer to a cluster?
I want to display the serial data on a cluster with several controls instead of an array
thanks to all
02-29-2020 04:42 AM - edited 02-29-2020 04:44 AM
Can you post some code that you have done so far so we can getter a better idea of what you are trying to achieve.
as a starting point look and the bundle by name function in the clusters palette. To help Lear how you use it look at the detailed help for that function (make sure the help window is visible, Ctrl +H, hover over the bundle by name and press detailed help.
also. I imagine there will be some data parsing. Converting the data from the serial buffer to whatever you have in your cluster. Without know what data you are working with it is difficult to offer any advice
02-29-2020 05:55 AM
Hi Niatross
Thanks for your reply. Imagine for getting 4 bytes from visa serial and showing on control displays of cluster what should I do?
I have done it with array (in the attachment) but I want to know how it would be done by clusters?
Thanks
02-29-2020 08:05 AM - edited 02-29-2020 08:55 AM
Hi Laian,
@Laian wrote:
Hi Cbutcher
this is my VI for just 4 bytes.
This is very convoluted…
No need to check if you really read 4 bytes: either you get your 4 bytes or you get an error…
No need to check if you really wrote 4 bytes: the bytes will be written to the serial port buffer - or you get an error…
No need for the sequence frame.
No need for two (different) wait statements in the loop…
No need for all those coercion dots!
Are you reading/writing just bytes (U8) from/to your microcontroller? Are there any other datatypes involved?
It would be much better when you could give an example of the data structure you are transporting with those 300 values. This way we can give examples on how to decode that data structure from the string and how to convert back to string after modification…
Edit:
Laian, please don't start the very same question in several threads! Keep discussion in one place!
Example for using a cluster:
(using UnflattenFromString)
02-29-2020 09:27 AM
@Laian wrote:
Hi Mark
So what is your suggestion?
Imagine you want to monitor the variables and flags of your software code of Micro to verify its execution and you don't have any hardware platform to test the code and just Labview can help you 🙂
Thanks
Without knowing your specific data it is hard to say what would work best. Some suggestions though would be to use a table or a tree to display the data. If you simply want to view a larger piece of memory from the micro controller then I would use a string indicator and display the data as hex values. Somewhere I have some code that formats binary data and displays it similar to what you see in something like Wireshark. The data includes "addresses" so it is easy to look through a large buffer. Some of your data might be best display as some clusters. Another approach would be to use a tab structure and break you data up into more meaningful pieces and have a tab for each group of data.
When designing a UI the general rule of thumb is that after about 7 pieces of important data, people start to lose focus of what they are seeing.Having 300 controls is simply too complicated to really be meaningful to anyone.
02-29-2020 10:34 PM
Hi Laian,
@GerdW wrote:
It would be much better when you could give an example of the data structure you are transporting with those 300 values. This way we can give examples on how to decode that data structure from the string and how to convert back to string after modification…
As Gerd said, there's actually not really any "handling" per-say in your uploaded VI.
That makes it more or less impossible to suggest changes.
Below is a possible example for handling a fictional collection of bytes. Obviously this won't directly work for your code, since I made up the values...
Decode Values
Here is the VI to produce the string I used. Of course, this is probably the code equivalent to that on your microcontroller:
Encode Values
Your code is probably very different, but this hopefully shows at least one way to split values into multiple controls (including clusters) and then display them in more useful blocks.
If you show us a more realistic version of your code, maybe we could show you various ways to handle it.