05-20-2012 04:37 AM
Hello,
I would like to create something like this:
It would go up to a couple thousands. I have tried to do this with the scripting method. There are other things I am doing in the vi (and in the case structure..this is just an oversimplification), so I do not want to create a new vi, but rather, after opening a reference to an existing vi, I would like to:
1. find the case structure (which I can do fine)
2. duplicate a frame (no problem)
3. Find the constant (can't seem to get that part)
4. change its value (not there yet)
script_processv2.vi is supposed to change the writearray.vi case structure. Let me know where I am doing something wrong.
Thanks
Solved! Go to Solution.
05-20-2012 08:11 AM
You know, I'm often accused of being "brash", or "coarse", or "insensitive", or "blunt", or "insulting", or (god forbid) "grumpy". We're told that we need to be "nurturing" and "understanding", and "comforting", and "non-judgmental". But I think I think honesty is at times necessary, and I think I'm well justified in asking here this question: how drunk does one have to be to think that having a case structure with a "couple thousand" case items is actually a good idea? And, that's actually, as you say, an oversimplification. ![]()
I'm asking in all honesty here, because I don't drink alcohol, so I don't know first-hand the effects of inebriation on the cognitive process of the human mind.
You really need to explain what it is that you are trying to do at a higher level, rather than asking us how to do this very focused operation, which is fundamentally ludicrous.
05-20-2012 08:34 AM
Oh, and just so I'm not accused of being "unhelpful", attached is one way as to how you can actually do it, should someone else come along and decide that they only need a couple hundred cases, and want to know how to use scripting to duplicate case items. Note that the writearray was modified to rearrange the case items.
05-20-2012 11:44 AM
LOL I know it looks ludicrous. What I'm trying to do is "insert into array" at different locations in one clock cycle. (the subset array doesnt allow this). This is being done on an FPGA. I know the array is huge and it will probably take up half the FPGA. "insert into array" requires that the index is a constants when used in FPGA, so I can't simply wire a control to the index.
Higher level up: I am trying to do some image processing on the FPGA. The frame grabber is NI PCIe-1473R. What I am currently doing is simply streaming the images I get from the camera to a DMA (I started off with the 10-Tap 8-Bit Example with DRAM), using the DRAM as a FIFO. Now I want to do a 3x3 convolution (sobel), so I need to save the data someplace other than a fifo. I spent several days trying to switch out the FIFO for an actual addressable memory but it is much slower and the normal streaming is affected. So I thought of sending this data to an array as it comes in, and when enough data (3 lines from the image) is in the array, I will start the sobel filter. The array will have a total of 2040 * 3 U8 elements. 2040 is the maximum width of the image. I just hope the vi will compile! If it's too much, I'll have to think of another way...
I thought of instantiating block memory and using them but it got too complicated.. I'll probably start with that if the huge array fails.
05-20-2012 10:50 PM
Nope. Too large. And I'm instantiating 10 of those vis.. The vi has a case structure with 6000 cases. Should have known it won't compile. Labview crashes when generating intermediate files. You answered my initial question though, thanks.
07-29-2013 04:09 PM
Hi,
I found these vis useful and would like to adapt them into my program. I have a case selector within a for loop which is within a while loop. When I try to reference the case selector I get an error saying it could not find it. I figured that it has to do with the case selector being within the for and while loops. Could you please explain how, if possible I could adapt your script to duplicate cases in this scenario? Thank you.