08-21-2023 12:23 PM
I am currently trying to find the voltage taps for 6 different supercapacitors. I am currently using a counter to cycle through the different supercap modules, but the issue is it is causing the graph of the voltage taps to be jumpy because it needs to go through all six before going back to the first one. When I try to do each supercap individually it looks fine though. When I tried to do all six at once since they all use the same transmit frame it makes it so only one supercap module data is collected. Is there a way to read the data from each module at once instead of cycling through the modules?
08-21-2023 01:01 PM
Hi Ryan,
do you really need 6 different (missing) subVIs to handle 6 channels of data?
Btw. all subVIs and RT/FPGA information is missing as you didn't attach the whole project…
@Ryan8542 wrote:
but the issue is it is causing the graph of the voltage taps to be jumpy because it needs to go through all six before going back to the first one.
When I tried to do all six at once since they all use the same transmit frame it makes it so only one supercap module data is collected.
So there is one "transmit frame" that contains data of all 6 voltage channels - but only one channel contains useful data???
Which graph are you talking about?
Maybe you should attach ALL the code/project!
08-21-2023 01:13 PM
This is the rest of the code
08-21-2023 01:30 PM - edited 08-21-2023 01:36 PM
Hi Ryan,
why is the project organized the way it is?
Why are subVIs of the RT main function placed under the "My computer" target?
Are you sure you need those complicated subVIs to handle/parse CAN messages?
Does your TransmitFrame really contain 9 data bytes when you handle the message in the ReadModule subVI?
Do you really need to convert the payload bytes to I32 values before placing them back into the message???
See this:
(Removed all unneeded stuff apart from coercion dots. It's still wrong to convert arrays to clusters and back to arrays: there's a function called ReplaceArraySubset!)
I gave up on your Main2.vi because of way too many shift registers: why not handle the (current) voltage data as an array in the RT and using just one (1) shift register in the PC host to hold the voltage data history?
How many cells do you need to monitor?
You need to read messages 0x411/0x511 to receive 3 voltage values with each message. In the end your RT host should hold all voltage values in one 1D array and only replace the last message data in that 1D array. This way that array will always hold the last known data of all channels: much easier to maintain than 6 individual shared variables!