06-25-2010 07:30 AM
Hello Jim,
When Iam trying to open the vi the program is looking for some sub vi's, and its showing a error message. Iam attaching the snapshot of the subvi's Iam missing. Can you please let me know how I should open this.
Thanxs
-Raghu
06-25-2010 07:50 AM - edited 06-25-2010 07:52 AM
Yes Jim I am trying to match the order of the elements in "scaled data, "matches the order in "User input".
Instead of entering the channel values as the 2-D array like for the first PGN 18ff0fef we should enter the array as Array_1= 4,3. User should enter 4 and 3 in different arrays. But the program should convert by itself in to a 2-D array and pass it to scaled data.
On thing we should be carefully addressed is in the Output.vi the for loop (scaled data) for each iteration its taking one PGN , its corresponding channels and values and writing to the Engine ECU. For the next iteration it takes second PGN, Its channels and values and passes to ECU. So we should be careful in sending the scaled data to the for loop.
This is what we are finally trying to achieve Jim. Can you please give your support in addressing this issue.
Thank's,
- Raghu
06-28-2010 05:17 AM
You need to install the OpenG VIs. Here's how.
06-29-2010 05:35 AM
Raghu,
It would help me if you would post a mock Front Panel with the inputs and outputs as you'd like them. I don't understand what you're getting at and "a picture is worth a thousand words".
06-29-2010 07:09 PM
Hello Jim,
Here are two images Mock_Front_Pannel_Current.png and Mock_Front_Pannel_Desired.png, which describes what Iam trying to achieve.
Mock_Front_Pannel_Current.png describes the current position of the program, how the user is entering the channels and its corresponding values.
Mock_Front_Pannel_Desired.png describes what Iam trying to achieve. Originally the scaled data array is of 2-D, this should be replaced with a single dimension array as shown in the image. And also as discussed earlier vi transmit messages(channels)to ECU correctly only if the messages are defined in the ascending order(the order in which they are defined in the *.dbc file). suppose
14FF0EEE has the following channels
1) ClutchPressure
2) Coolant_Temp
14FF2FFF has the follwing channels
1) Oil_Pressure
2) Imat
And if Iam interested to write the following channels with the following values
1) ClutchPressure = 500
2) Oil_Pressure = 75
3) Coolant_Temp = 50
In the present program I have to enter the channels and values as shown in Mock_Front_Pannel_Current.png. I have to follow the order as they have defined in the *.dbc file and enter the values in the same array if two channels belong to the same PGN.
Now with out touching the present code, I wanted to work some thing outside of this code, which take care's of the ascending, descending order problem and the conversion of 1-D array to 2-D array. As shown in the Mock_Front_Pannel_Desired.png, user can enter the channels in any order and its corresponding values in a 1-D array(whose value index matches with the channel name index)
I have the code which pulls all the channels listed out in the *dbc file and store's in a 2-D array, PGN wise.
Can you please help with the other part, arranging the order of channel names and conversion of 1-D array to 2-D array and passing to the program.
Thanxs
-Raghu
06-30-2010 05:50 AM
I've added a piece to order the Scaled Data. I'm still not clear how you want to present the data from my VI to your main program; your mock-up only showed controls. What should my indicators look like?
Notice that my indicator "reordered Scaled Data" has the "Scaled Data" in the order you need.
06-30-2010 07:45 AM
Hello Jim,
Attached picture shows how Iam trying to integrate your VI in to my VI. In the present VI the indicator "reordered scaled data" should be converted to a 2-D array as shown in the picture ("Final Scaled data").
This 2-D array should be arranged in such a manner that all the values belonging to the first PGN should be in the first array, values belonging to the second PGN should be in the second array and like wise(but should be arranged in ascending order as you did for arranging the channel names).
So that I can directly feed your VI output as my VI Input.
Thank you,
- Raghu
06-30-2010 08:23 AM
06-30-2010 11:38 PM
Hello Jim,
Thanxs for your help. This is what we are trying to achieve. Jim when I try the run the VI. I see there are some blank array elements in the Result indicator and "0" values in the Final scaled data indicator (which can be seen in the attached image). Is there any way to get rid of this undefined array elements, leaving the cells deactive.
And also Iam trying to make a sub VI for the whole program, so that I can just add a small block in my main program , Can you please let me know if this can be done or not.
Thank you,
- Raghu.
07-01-2010 05:46 AM
[...] there are some blank array elements in the Result indicator and "0" values in the Final scaled data indicator (which can be seen in the attached image). Is there any way to get rid of this undefined array elements, leaving the cells deactive.
That's an inherent behavior of 2D arrays; each dimension must be the same size so the shorter rows are "padded" with the default value for the arrays data type (empty string and zero for string and numerics). I'd suggest modifying your main program to ignore the empty string and corresponging Scaled Data.
[...] Iam trying to make a sub VI for the whole program, so that I can just add a small block in my main program , Can you please let me know if this can be done or not.
This can be done. Make the Array Constant into a control that you'll wire the definitions from your *.dbc file and fill up the connector pane.
Please mark one of my posts as the solution. I'd sure appreciate it; I haven't written many solutions recently...