Gazzr Posted April 18, 2007 Report Posted April 18, 2007 I wish to edit a string using a TD200C panel. The string consists of only 1 letter. If I first use the STR_CPY instruction to write the value "A" (For example) to location VB500. I can display this and edit it using my panel - no problem. But if the location is empty I still want to be able to set a single letter string there via the panel. I think this has something to do with the string length being contained within the first byte of the string, but I am unsure how to overcome this...? I hope this makes sense, any advice would be appreciated. Quote
504bloke Posted April 18, 2007 Report Posted April 18, 2007 Use the STR Copy command and copy " " to your VB500 (NOTE THE SPACE) In STL SCPY " ", VBVB500 VB500's first byte will then be 1 giving a string length of 1 and you are using a SPACE I just tried it on a 226 on my desk and it works but i have no TD200 as i dont use them. Quote
Gazzr Posted April 19, 2007 Author Report Posted April 19, 2007 So do you think this would work if I used the MOV_B to write the value 1 into VB500? I ask this because if I used STR_CPY to copy " " into a set of locations it might overwrite anything that may be there. If the MOV_B worked I could have it switched on for every scan and it wouldn't affect any existing data but would (hopefully) prepare the empty locations for editing on the TD. Struggling to trial this as I don't have a spare TD200C, the only 1 I have is in production. Quote
504bloke Posted April 19, 2007 Report Posted April 19, 2007 (edited) I would........ Do a compare first to see if VB500 is 0 which should mean that your problem exists ie String contains nothing "" If the compare is true then use STR_CPY to copy " " to VB500 If the Compare is any thing greater than 0 then the string will stay as it was and the rung will be ignored STL LDB= VB500, 0 SCPY " ", VB500 Edited April 19, 2007 by 504bloke Quote
Gazzr Posted April 23, 2007 Author Report Posted April 23, 2007 Thanks for the that I will try it later. Pretty simple really, but it usually is. Cheers. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.