GI Jimbo Posted July 1, 2024 Report Posted July 1, 2024 I have a string of ASCII characters stored in location D10300. I used LEN$ to get the number of characters (31 or #001F). However, when I try to use RGHT$ D10300 #001F D1020, nothing is being copied to D1020. Any ideas as to what might be the problem? There's plenty of room at/after D1020 to contain the 31 characters + #00 or #0000 null terminator. Any help is appreciated. Quote
GI Jimbo Posted July 1, 2024 Author Report Posted July 1, 2024 Sorry for the double post, I got an error when I tried to edit. I even tried to use MOV$ D10300 D1020 and it's still not copying. Quote
GI Jimbo Posted July 2, 2024 Author Report Posted July 2, 2024 (edited) For a little more context, I've been trying to complete this operation in a sub-routine (SBN). I tried running the functions outside of the sub-routine and found that MOV$ completed if its input was the P_On (always-on) contact. This leads me to think that my sub-routine must not be allowing enough time/cycles for the RGHT and/or MOV operations. This leads me to another question. How do you ensure that just enough time is given to RGHT or MOV operations before moving to the next operation which depends on their completion? Typically I'd expect there to be some sort of done bit for operations that do not complete immediately. From what I see in the instruction help, there doesn't appear to be one. However, the ER and '=' flags are mentioned. The instructions state that the '=' flag will be on if #0000 is output to D. If I add a contact/condition dependent on the '=' flag not being on, will this effectively act as a done bit? Thanks in advance for any responses. I'm an Omron newbie so any guidance is appreciated. Edited July 3, 2024 by GI Jimbo clarified that I only tried P_On with MOV$ Quote
GI Jimbo Posted July 3, 2024 Author Report Posted July 3, 2024 (edited) Well it seems that this isn't related to the sub-routine or the timing. I set up some test logic at the beginning of my program and gave it a timer of 10 seconds to complete the RGHT$ operation and still nothing. I created an output to get triggered if there's an error code and found that it is getting triggered. Per the CP1H programming manual, the ER flag is: ON if more than 4,095 characters are designated by S1. This certainly isn't the case as the LEN$ function run right before is returning 31 characters. ON if more than 4,095 characters (0FFF hex) are designated by S2. This certainly isn't the case as the destination address has 49 characters available and is full of zeros/NULLs. ON if the Communications Port Enabled Flag for the communications port number specified as the Com Port number for Background Execution is OFF when background processing is specified (CP1H only). I have no idea what this is. I tried searching the manual for "Background Execution" and only got results in each of the string function error code possibilities. Would someone be able to point me in the right direction here? OFF in all other cases. Edited July 3, 2024 by GI Jimbo 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.