취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

String problem

해결 완료!
솔루션으로 이동

Hi, 
I am trying to read information from an encoder in order to control the position to a motor. 
However, when I try to read the encoder information, I seem to get a hexidecimal number I can do anything with. Does anyone know what I can do to get a integer value from the encoder. 

Any help would be highly appreciated

Vegard

0 포인트
1/10 메시지
5,048 조회수
솔루션
승인자 Vegard123

Hi Vegard,

 

posting an image is better than just writing text. But posting a VI/snippet would be much better than a simple image!

 

I guess your string indicator "EncCnt" is set to "Hex Display" mode. If this is the case you should typecast the received string to an U32 value…

 

Or use DeserializeString:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
2/10 메시지
5,009 조회수

I see. 
I will try to convert it to U32. Thanks!

0 포인트
3/10 메시지
4,982 조회수

 I tried to typecast the string, but the info I got out of it was weird I think. It did not return numbers, just weird letters.. 

0 포인트
4/10 메시지
4,971 조회수

Hi Vegard,

 

sorry, can't open your LV2015 VI. Please downconvert to LV2011 (or LV2014)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 포인트
5/10 메시지
4,957 조회수

Why are you typecasting a string into a string?  That does nothing.  Instead, wire an U32 into the "type" input.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
6/10 메시지
4,944 조회수

That is what I am trying to do, I inserted Control into the type input, but I could not seem to be able to put U32 into the typecast..

0 포인트
7/10 메시지
4,933 조회수

Sorry, figured it out. Really simple, but not so easy when I am new to the program

0 포인트
8/10 메시지
4,929 조회수

Why don't you post your solution instead of just saying you fixed it so other people can benefit from your experience?

 

This is a chance for you to be the teacher in a learning forum.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 포인트
9/10 메시지
4,910 조회수

Would gladly post my solutions. Right now it is packed into quite a bit of code. But the thing was really to make a numeric constant and change the representation to U32. Then wire it to the 'type' terminal on the type cast block. 

 

If anyone should ever be interested, this is the VI i made for rotating one rev forwards. 

10/10 메시지
4,875 조회수