chrisb4748

Indexing Table

4 posts in this topic

Hi,

I'm wanting to create an index table consisting of 1000 "Dollies".

Within my "CognexTable_Write" function block i was wanting to use i_Dolly_Number as my index but found out I couldn't have a string as an index. 

Is it possible to get D3000 (which is my dolly number, as a string) into word format looking exactly the same as D3000?

Many Thanks :D

 CognexIndex.PNG.9739d19017bbafd5433687b9 

CognexTableWrite.PNG.db76ccd602599292b23

Share this post


Link to post
Share on other sites

HABIN is hexadecimal ascii data converion.

DABIN is Decimal ASCII data conversion => You should get 568 as a decimal number in your Dollyindexed variable 

Edited by Gambit

Share this post


Link to post
Share on other sites

When I put in DABIN I get an operation code 4100. I think this has something to with the 0 at the start of my dolly numbers (D3000). Should I compare the start of the string and drop off any 0's? 

 

Edited by chrisb4748

Share this post


Link to post
Share on other sites

That could be the case. If so  just add  <> 0 before the instruction. For testing you can also change the PLC RAS parameters in the CPU so that the CPU doesn't go into stop.

You will still get the error but the program will keep running 

Edited by Gambit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now