LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

new folder

Dear Smercurio_fc,
 
At the beginning, Thank you for your discriptions and suggections. It is very useful for me. And i need to apologize my jokes.
About the using and concept of the Time delay, I am more clear now and I will use it to improve my program.

In the pervious post of Ton, I got a wrong meaning about the Coeff A & Coeff B. I understand the meaning after reading your message. Maybe i am new user of Labview and I still have not many using experience on it, I still have some questions about part of Coeff A and Coeff B. Would you mind answering me??
Question : What is the different/effect of case A and Case B in the disgram? (attachment)
Will the running time different? or the memory problem??

Maybe i explained the 'dB values Convection & Calculation" not clearly. Let me explain again.
In 'dB values Convection & Calculation', the for loop is required.
When i give a order to a machine, the machine provide
 a string of Hexadecimal string to me each cyclic.
The for loop is used to convert a string of Hexadecimal string to 4-bits Hexadecimal string and then convert them in to decimal number for calculation. (Result : a many number of 'dB's).
The while loop is used to get a string of Hexadecimal string from the machine continuouly(per second).Because it is real time system, the string of Hexadecimal string are not constant.  

Thank you and Please give me any suggections or opinion after seen. ^^

KIM

0 Kudos
Message 21 of 30
(1,255 Views)
Dear Smercurio_fc,
 
At the beginning, Thank you for your discriptions and suggections. It is very useful for me. And i need to apologize my jokes.
About the using and concept of the Time delay, I am more clear now and I will use it to improve my program.

In the pervious post of Ton, I got a wrong meaning about the Coeff A & Coeff B. I understand the meaning after reading your message. Maybe i am new user of Labview and I still have not many using experience on it, I still have some questions about part of Coeff A and Coeff B. Would you mind answering me??
Question : What is the different/effect of case A and Case B in the disgram? (attachment)
Will the running time different? or the memory problem??

Maybe i explained the 'dB values Convection & Calculation" not clearly. Let me explain again.
In 'dB values Convection & Calculation', the for loop is required.
When i give a order to a machine, the machine provide
 a string of Hexadecimal string to me each cyclic.
The for loop is used to convert a string of Hexadecimal string to 4-bits Hexadecimal string and then convert them in to decimal number for calculation. (Result : a many number of 'dB's).
The while loop is used to get a string of Hexadecimal string from the machine continuouly(per second).Because it is real time system, the string of Hexadecimal string are not constant.  

Thank you and Please give me any suggections or opinion after seen. ^^

KIM

0 Kudos
Message 22 of 30
(1,255 Views)

@kim515 wrote:
Question : What is the different/effect of case A and Case B in the disgram? (attachment)
Will the running time different? or the memory problem??


In both cases there is no wire connected between the sequence frame and the while loop. This means they are independent entities and they execute simultaneously. Thus, in case A, the while loop can read the local variable before you've written the value to the indicator. This is also known as a race condition. The same exact situation exists in case B, though the race condition is more likely to happen in this case since the sequence frame requires that an additional operation occur before the "Numeric" indicator is updated. This is part of what we've been hampering about: dataflow. In fact, you can rewrite the cases as:

and they would be more reliable since there are no race conditions caused by the local variables and disassociated sequence frame and while loop.


@kim515 wrote:
In 'dB values Convection & Calculation', the for loop is required.
When i give a order to a machine, the machine provide
 a string of Hexadecimal string to me each cyclic.
The for loop is used to convert a string of Hexadecimal string to 4-bits Hexadecimal string and then convert them in to decimal number for calculation. (Result : a many number of 'dB's).
The while loop is used to get a string of Hexadecimal string from the machine continuouly(per second).Because it is real time system, the string of Hexadecimal string are not constant. 


You do not need a for loop to convert a string to a sequence of numbers. The following accomplishes the same thing, based on the example you provided earlier:




Message Edited by smercurio_fc on 01-22-2008 09:36 AM
Download All
0 Kudos
Message 23 of 30
(1,238 Views)
Dear Smercurio_fu,

Oh!Thank for your help. I am more understand the different of case A & B now.

Secondly, Thank for your suggections and hints for the for loop case.
I have used this method but it is not useful in my case. In my program, the number of Hexadecmical character of string are unknow and maybe more than 30000 characters providing each time. If I use your suggestion to convert them, the setting of string format maybe "%4X" with 30000 times. And I need to check the value of each decmial number. However, I only can use for loop to do this conversion and checking section before I think a new idea/method. ^^! Anyway, Thanks for your concentration on this part.

Lastly, I got a bad news in this morning. I have used NI Vision to develop a webcam in my program. Unfortunately, I discovered my NI Vision which was a trial version. I will not use it in my presentation day. AR~~~~~~~~~

KIM~

0 Kudos
Message 24 of 30
(1,229 Views)
OK, but that still doesn't explain why you have a while loop that's sitting around waiting for a front panel Boolean to be set to true before you just parse a string. Why do you need to wait for the toggle to be set to ON before you parse a string? That doesn't make a whole lot of sense.

Also, you're initializing a 2D array and then replacing the elements with the converted values, which you got by auto-indexing the for-loop. This is redundant. I suspect you have a background in text-based programming, given the way this is coded up. You can recode the for-loop this way:



Message Edited by smercurio_fc on 01-22-2008 12:50 PM
0 Kudos
Message 25 of 30
(1,213 Views)

Dear smercurio_fu,

Do you mean this while loop??(Attachment) If you mention this one, I explain to you now.
I want to create a program which look like a real electronic machine. It includes Power ON/OFF, monitor, value button, etc..
Therefore, I used this while loop in the power ON/OFF function. I can use this function to stop this program for a while which can instead of pressing "run" again to restart. 
When it is true, the program can run continuouly. When it is false(Power OFF), the state only loop in this while loop and It looks like a Power Off state. All functions of the program look like stop until i switch to Power ON.

Is It a stupid method?? Because i Just know this method to do that.

So thanks for yours example. It is a good hint for for me but I have some commands which I don't know how to use it and its function. Can you tell me? I have circle them in the Attachment.

THANK YOU AGAIN~

Kim

Download All
0 Kudos
Message 26 of 30
(1,200 Views)
My point wasn't with the existence of the while loop. It was with where you had placed it. It made no sense for it to be inside the for-loop. Take a look at it this way. This is what your code is doing:
  1. Read in some values from device (number of points, etc)
  2. Start a for loop that runs based on the number of points.
  3. Wait in a loop until the front panel ON/OFF is set to true.
  4. Convert first number.
  5. Return to beginning of for-loop.
  6. Wait in loop until the front panel ON/OFF is set to true.
  7. Convert next number.
  8. Return to beginning of for-loop.
  9. Wait in loop until the front panel ON/OFF is set to true.
  10. Convert next number.
Do you see how this makes no sense? I'm sorry, but I can't really explain it any clearer than that.

The items you circled are a shift register and the standard Build Array. These are basic elements of LabVIEW. If you do not know what these are you need to open the LabVIEW book and start reading. Also, you need to go through some of the tutorials. You can head over to the Learning Center for more learning resources.
0 Kudos
Message 27 of 30
(1,190 Views)
Dear smercurio_fu,

I understand you point now. Frist of all, I am sorry. It is v7.1 and i have discover this studiping problem at last week. Therefore, i have correct it and developed to v9.2. I am so sorry to waste your time to explain this problem to me ^^!
 
SORRY^^!

KIM
0 Kudos
Message 28 of 30
(1,188 Views)
There is no need to apologize. We all had to learn at some point.

I would still strongly recommend spending some time with the tutorials and in the Learning Center.
0 Kudos
Message 29 of 30
(1,181 Views)
Dear smercurio_fu,
 
I am happy to have your recommendations and i will take the tutorials.
I still have some question about the sequence sequence. If there is a procedure which can run at any moment. It means that it is not  limited at any sequence of data flow. do you still put in the sequence  structure?? Let us use the "while loop Power on/off" be a example. do you think it need to put it into the first page of sequence structure or not? In my opinion, there is not any different between put in or not. The sequence flow of the program are same. 

In addition, I learn Labview because of my final year project. In fact, does it always use in engineering working?
Thank you.
 
Kim ^^!


Message Edited by kim515 on 01-23-2008 10:42 AM
0 Kudos
Message 30 of 30
(1,179 Views)