LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continous operation

Your string array consists of strings that are in hex display mode. The case structure has a string wired to it, but the case structure still only sees the the character that 0x88 represents, which is "X". However, the case is set up to respond to the characters "88". That's NOT the same as the number 0x88. Thus, regardless of which array element you give it, the "Default" case is the one that will run each time. If you want to specify case values as hexadecimal then you need to feed a numeric, not a string. The example that 10degree had given would have gotten you there. All you had to do was replace the Number to Decimal String function there with the Type Cast function. That's it. 

0 Kudos
Message 11 of 72
(1,250 Views)

i hope there is no problem with case structure because i saw when 88 writen to the port which get back the valu and i displayed in respective textbox. You mis understood my problem that always writing 88 and reading the same value but its not going ahead and not writing next 89. So i want to write always one by one command. not all at a time and not one.

 thank you for your quick reply...

0 Kudos
Message 12 of 72
(1,242 Views)

I understood your problem perfectly, and I can see it directly from the code. The issue is that you're not understanding us. Your string array is autoindexed. That means in each iteration it will write out the next byte. The problem is with how you are evaluating the case structure. Please re-read my response.

0 Kudos
Message 13 of 72
(1,237 Views)

As Smerucio says, a string case cannot be set in hexadecimal mode, thus in loop #1 you're comparing 0x8D to 0x3344 ("8D"). You'll need to add a Decimal string to number to correct it.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 14 of 72
(1,215 Views)

Hi,

     still the problem is not rectified even if i use decimal string to number or hex string to number. Always they interpret as zero whet ever the input coming in and also my loop that means everytime one command only running and default case is displaying the result.

0 Kudos
Message 15 of 72
(1,191 Views)

Please post your actual VI so we can determine how your display settings are set on your constants.

 

My guess is that the 88 string is set for hex display.  That is the character ^ which can not be put into hex string to number since a carat has no meaning has a hexadecimal digit.  Only 0-9,A-F have any meaning.

 

If you want to convert the hex character of 88 (^) to a number then you use typecase, but wire a U32 into the top and not a string.

0 Kudos
Message 16 of 72
(1,168 Views)

Yes, i am using hexadecimal string and i don't why always default case is running. even i woul like to do first 88 command execute and 89 and so on one by one. but it always resulting only one one value for first command i.e. 88 and simply getting out of the for loop and even not coming out of the while loop. Vi is attached and using labview8.5.

0 Kudos
Message 17 of 72
(1,163 Views)

Type cast

 

But I see you have already been getting this advice here. serial communication without string

 

0 Kudos
Message 18 of 72
(1,157 Views)

My bad, you need a Type Cast to U8. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 72
(1,148 Views)

everytime i am silly questions on you. I fell my self bad and though i can't go forward without your help because i am new to these virtual environment. However, before message about typecast, how i can chage datatype of type terminal to different methods now it is showing string for me. How i can draw like U32 there and i saw there is no options on right click.???

0 Kudos
Message 20 of 72
(1,142 Views)