Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ksasikumar on April 06, 2023, 05:45:59 PM

Title: Move Instruction not working
Post by: ksasikumar on April 06, 2023, 05:45:59 PM
Hello! I am using the MOVE instruction to move a constant value to an RY memory address. I am doing this in a few parts of the program for different memory addresses and noticed that the value in the destination is not changing in one of the rungs of the program. I'm not sure what could be causing this - the memory address is not used in other parts of the program. I have attached pictures of the rung that works and the one that doesn't. I also tried using COPY instead and it didn't work there either. The only option is to force the value.
Title: Re: Move Instruction not working
Post by: rlp122 on April 06, 2023, 07:21:23 PM
Your PID is overwriting it.  If you want to write a manual value, you need to put the loop in manual.
Title: Re: Move Instruction not working
Post by: ksasikumar on April 07, 2023, 09:22:46 AM
The memory address in the MOVE instruction is not used in the PID instruction.
Title: Re: Move Instruction not working
Post by: BobO on April 07, 2023, 12:32:53 PM
The memory address in the MOVE instruction is not used in the PID instruction.

Check your cross reference. Something is likely writing to it somewhere.
Title: Re: Move Instruction not working
Post by: ksasikumar on April 11, 2023, 03:56:56 PM
I double checked. I have it being used in another PID instruction, but that instruction is in manual mode. I have similar PID loops elsewhere in the program, but I'm only having an issue with this one memory address.
Title: Re: Move Instruction not working
Post by: BobO on April 11, 2023, 04:17:08 PM
I double checked. I have it being used in another PID instruction, but that instruction is in manual mode. I have similar PID loops elsewhere in the program, but I'm only having an issue with this one memory address.

If you want to send your project to Host's support email, we're happy to look over it. It would be very unlikely for a MOVE instruction to be failing, so there is likely something else going on.
Title: Re: Move Instruction not working
Post by: mhw on April 12, 2023, 10:46:16 AM
If you have enabled scaling for WY1 then the value in WY1 will automatically overwrite RY1.
Correct?
Title: Re: Move Instruction not working
Post by: franji1 on April 12, 2023, 12:26:02 PM
If you have enabled scaling for WY1 then the value in WY1 will automatically overwrite RY1.
Correct?

The opposite - since WY/RY is an OUTPUT, you write to RY (engineering units) and the I/O Driver scales the RY value to the WY analog channel.  So you cannot write to WY directly - it will be overwritten by the scaling of RY back to raw units.

WX/RX (input) behaves as you described.  The value in WX1 will automatically overwrite the value in RX1, so writing to RX1 doesn't do anything.