12-04-2023 11:48 AM
Hello. I am new to Labview and currently trying to revive and edit a .VI that was built using Labview 2009. I would like to continue to use Labview 2009 if possible.
The purpose of this .VI is to shift the x,y coordinates of a circular target by randomly jittering the target position using a uniform distribution of +/- 10 deg around the starting location.
I have attached two files:
"number of pointsshiftedMaster_v2.vi" Is the original file. Where the "Shift" variable is a constant that can be entered on the front panel (example: 10 degrees). This file works but only allows me to shift the target position by a fixed value (does not allow me to jitter the target position using uniformly distributed random values).
"number of pointsshiftedMaster_v3.vi" is the new edited file where I have attempted to implement the desired changes. I am hoping to make it so that the jittered target position only occurs when the "Two Target (RS)" condition is "True". When "False" I want the .VI to function the same as the original file "number of pointsshiftedMaster_v2.vi".
Currently, I receive the following error message:
"You have connected two terminals of different types. The type of the source if double [64-bit real (~15 digit precision)]. The type of the sink is 1-D array of double [64-bit real (~15 digit precision)]."
Hoping to find advice on how to change the data type or fix this file. Thank you in advance.
Solved! Go to Solution.
12-04-2023 01:48 PM - edited 12-04-2023 01:51 PM
Hi Beecl,
@Beecl wrote:
I have attached two files:
"number of pointsshiftedMaster_v2.vi" Is the original file. Where the "Shift" variable is a constant that can be entered on the front panel (example: 10 degrees). This file works but only allows me to shift the target position by a fixed value (does not allow me to jitter the target position using uniformly distributed random values).
"number of pointsshiftedMaster_v3.vi" is the new edited file where I have attempted to implement the desired changes. I am hoping to make it so that the jittered target position only occurs when the "Two Target (RS)" condition is "True". When "False" I want the .VI to function the same as the original file "number of pointsshiftedMaster_v2.vi".
Currently, I receive the following error message:
"You have connected two terminals of different types. The type of the source if double [64-bit real (~15 digit precision)]. The type of the sink is 1-D array of double [64-bit real (~15 digit precision)]."
Hoping to find advice on how to change the data type or fix this file. Thank you in advance.
Your first VI shows some lack of understanding: using an autoindexing tunnel would be sufficient instead of shift register+InsertIntoArray!
See this:
(You could simplify this even more using complex numbers. I left that part intentionally for Christian. 🙂 )
The second VI shows even more misunderstandings:
Now you create an array of 128 samples in that case structure, and insert that amount of samples with each iteration of the FOR loop into the array. Do you really want to insert 128 samples each time???
To answer your question: technically you need to insert a BuildArray function in the other case of your case structure so you create an array in both cases. But I guess using this approach will not give the expected result…
12-04-2023 07:15 PM - edited 12-04-2023 07:16 PM
@GerdW wrote:
(You could simplify this even more using complex numbers. I left that part intentionally for Christian. 🙂 )
…
Exactly. Here's how that could look like (and yes, it can be simplified further!):
(And please set typical default value for all controls.# of points=0, distance=0 are NOT reasonable! Also please don't maximize the diagram the the screen.)
And to add a +/- 10 degree jitter, just use a properly scaled dice.
12-04-2023 07:29 PM - edited 12-05-2023 10:35 AM
@altenbach wrote:
(and yes, it can be simplified further!):.
Here's a quick cleanup. Same result:
![]()
12-05-2023 10:42 AM
02-06-2024 12:19 AM
Thank you - this worked great!