LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continous operation

I think Yamaeda understood clearly.  Re read what he is saying.

 

Your inner For loop only runs one time because the local variable Read is True (if it wasn't it wouldn't have gone into that case of the case structure.)  So your For Loop stops after the initial iteration.  Thus the other commands in your array that are auto-indexed into the For Loop never run.

0 Kudos
Message 31 of 72
(2,044 Views)

Now my loop is working as i want but is that really good to take numeric indicators for writing user data to port. In my app, i would like to read the current value in smps and as well user can set some values into SMPS by just writing values to SMPS directly from numeric indicators(suppose user enter 24 in any of the text box under tab control only) by just taking the value and fulfill automatically the command(packet) by that value and just write to port.

 I don't think its really work or not because indicators will only for display the value or we can do like what i written before. when my app is running , i tried to write some value in indicators but it not allowing to me to write.

How can i do this operaton?

0 Kudos
Message 32 of 72
(2,028 Views)

It isn't clear what you are trying to do.

 

Indicators are used to display program data to a user.  Controls are used to take data from a user and use it in the program.  A control is a source of data, an indicator is a sink of data.

 

If you want the user to be able to enter data into the program, then you should be using a control, not an indicator.

 

If for any reason you need to do the opposite such as programmatically write data to a control, perhaps to provide the user with some default data, then you can use a local variable of that control to write data to it.

0 Kudos
Message 33 of 72
(2,024 Views)

i have five indicators down to the tabcontrol which are only for read and i used indicators. Problem is with indicators which are under tabcontrol because those are for read & display(by using command) and write(in this case command will change and useful for controling the SMPS) user can able to enter value in the textbox and it will return to the port with command. i know that i can't do these write operation from numeric indicators but how i can read, display and write from the same textbox. How can i achieve this.

0 Kudos
Message 34 of 72
(2,017 Views)

 


@shjukheter wrote:

i have five indicators down to the tabcontrol which are only for read and i used indicators. Problem is with indicators which are under tabcontrol because those are for read & display(by using command) and write(in this case command will change and useful for controling the SMPS) user can able to enter value in the textbox and it will return to the port with command. i know that i can't do these write operation from numeric indicators but how i can read, display and write from the same textbox. How can i achieve this.


This is one of teh few valid uses for a local variable. Local variables can either read or write from either a control or an indicator. Be careful when you use local variables because it is quite easy to create race conditions in your code which can result in unexpected behaviour.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 35 of 72
(2,012 Views)

Hi,

      I need to send whole command in 2 bytes according to  the specifications given by my instructors and here is the PDF(http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/commands-from-numeric-textboxes/m-p/1459654) with information about sending command(see 12 and 55 pages for format and data bytes required and last pages for table of commands). Now i am sending only command from my labview code which is in hex.

      My doubt is for the command itself taking two bytes i.e. each character in the command has taken as one byte. In given pdf, they written 1 byte for command code which rises doubt on my mind. The total packet structure is with Start bit as S next address bit(suppose say 15) next command code as one byte and next data bytes(possibly 2 bytes). But in labview while writing command code it self it takes 3 byte and i need to do all the command in possibly 2 byte. can any one expline how i can do this. As this the first time i am dealing with bits and bytes and confused a lot. Thanks in advance.

0 Kudos
Message 36 of 72
(1,992 Views)

As far i am dealing with hex strings and now in my code i was writing 8B(hex) to port to get the reply now i want change my command to following way(see pic). How i can simply write that whole command in array constant. First bit is S but in hex, S Is not available and its not taking . How can i write whole command once at a time.

0 Kudos
Message 37 of 72
(1,976 Views)

Please, some one can tell me how can write in hex command. In the command I have S as representing the staring of a packet and P as stop. I am not able to write the whole comand in hex. Some thirdparty company has developed a GUI which folow the packet structure as in the given image (See  the red circle in picture) and below there is real packet structure. Till now i am just sending the COMMAND CODE (like 88, 89 ....in hex) but its just a part in real structure. How can i write whole command in hex. Please, so far NI people are not responding to me and with out your help i can not move ahead, May be i had made you angry by asking silly questions. Please excuse me and help me out.

                                 Thank you.

0 Kudos
Message 38 of 72
(1,960 Views)

I think your questions are just confusing everyone.  You posted a link to a link to the manual.  What page is that manual should we be looking at?

 

You talk about sending a first bit as S?  What does that mean?  A bit can only be a 0 or 1.  There is no such thing as an S bit.

 

If you have a series of values in an array (let's say they are hex formatted so they show up as x88 in the array), you can use byte array to string to be able to send them to the VISA write.

0 Kudos
Message 39 of 72
(1,952 Views)

Hi shjuk,

 

the term "hex" has already been explained to you in your other thread over here...

 

What exactly do you want to show us in that blurry, downscaled JPEG?

You're talking about "S" "bit", but to encode a character needs a full byte, not a single bit.

What is this packet containing something like "S_" and "RS"? Are these "bits"? Are these some magic chars (aka single bytes)? Are these 2 chars in ASCII coding?

 

To get "hex" codes simply use "String to U8 array" as has been suggested several times in your other thread! Get your head clear to accept the fact that a string is nothing else than a "hex" byte array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 40 of 72
(1,951 Views)