12-25-2016 06:39 AM
I have no idea why my array of U8int can't pass the case structure while the array of strings of the NI example can pass.
Please advice.
Solved! Go to Solution.
12-25-2016 10:38 AM
I don't think you have anyi issues with your case structure.
I see you have an inner For Loop that runs X number of times. On your output tunnel, you have a shift register, but you never do anything with that data on the next For Loop iteration. Perhaps you actually want to build that into an array? Perpaps have a concatenating tunnel on the output of the For Loop instead of a shift register? Right now the data that comes out of the For Loop, and thus out of the case structure is what ever is generated in the last iteration of the For Loop.
12-26-2016 02:43 PM
I can't find a solution to get de data out of the CAN while loop, days and days trying....
Putting all the code in the CAN loop is also not a solution.
All i need is to be able to read the data, handle it once and send a new message.
12-26-2016 02:52 PM - edited 12-26-2016 02:55 PM
I can't debug a screenshot.
Please attach a VI, preferabley LV 2015 or older.
PS. Index Array is exandable. You don't need to make multiple copies or put in all the constants. Just drag the bottom border down and you'll get element 0, 1, 2, 3, .... automatically.
Also, use block diagram cleanup to get rid of backwards running and hidden wires. Also the output of the 10 msec wait timer function is almost always greater than 10 (it is the value of the PC's timer which is greater than 10 msec almost instantly after the PC boots.)
12-26-2016 03:36 PM
I'm sorry but i only have the 2016 student version, there was now other choice when i downloaded it.
In the mean time i would like to thank you for helping me.
I keep on wondering why the CAN loop won't pass any values. Why did the maker make use of an array of 8 clusters. Isn't labview fast enough to handle the CAN messages one by one. A simple µcontroller has no problem with that.. programmed with C.
12-26-2016 03:42 PM
In the File menu, there is a choice called "Save for Previous Version".
From the screenshot, I can't tell what is happening because there are several items called "Message ???" and an event structure that seems to be connected to one of them, but I can't see all that it says. There seems to be a very awkward communication scheme between the two loops using local variables, and no clear reason as to why you need two loops.
12-26-2016 11:15 PM
Saved it in V14.
The Messages and the booleans are just to have a view on what is happening while the program is running, all are numbered.
12-27-2016 12:28 AM
The first main problem I see.
Your lower while loop will only execute when the event structure has an event to act on. It has a single real event, Message 1 Value Change. But Message 1 is an indicator, so a user can't change it to fire an event. And there is no Value (Signalling) property node for that event structure being written to in order to fire the event. The only thing you have is the temrinal being written to in the other loop. Writing to a terminal does not fire a value change event.
I still don;t see why you can't do this in a single loop. Attached is a modified VI that puts it into a single loop. I won't guarantee it is 100% correct because there are still oddities in there such as the writing to a boolean constant to a local variable of the Write control. And other shift registers of booleans going in and interacting in ways that aren't obvious to me what you were trying to do.
12-27-2016 04:00 AM
Some things i'm not sure, have no idea, about how to implement in labview.
12-27-2016 09:46 AM
I think the CAN side of the program is solved.... ncAction.vi solved the problem with resetting the handled CAN-frame.
The opcode "Reset' is not an option, even the config data is lost then, i used sequential "Stop" - "Start".
Writing a CAN frame only once, i solved it with a sequence frame.
Still i'm having a problem with a grouped send function, i used a for loop for it but my "Write" value only seems to be forwarded at the end of the loop while the "Data to write" is correctly changed for every iteration.