DirectSoft 5 assistance

subjwd

Member
Join Date
Oct 2004
Posts
18
Please see the attached picture. I'm new to AD, but not PLC's.

I'm trying to subtract V20000 from V20002 and put it in V22000.

From the data table, I expect a value of 10550, but I get 54847, the same value as V20002.

Can anyone tell me what I'm doing wrong? Thanks!

DS5.jpg
 
Don't know AD stuff but those values are not within the range of a signed 16bit Word and may cause a overflow, underflow minor fault killing the instruction. Can you move up to double-word variables?
 
You are working with hex (aka binary) formatted numbers, not BCD numbers. To perform math on hex numbers, you need to use use the binary math commands. In this case, replace the SUB with SUBB.

The original SUB instruction was expecting a BCD number. When it saw a hex number it freaked out and froze like a deer in the headlights and did nothing. :)

Brian
 
Just to test that out, I tried values of 50 and 30, expecting difference of 20. Result was still 30.
 
Don't know AD stuff but those values are not within the range of a signed 16bit Word and may cause a overflow, underflow minor fault killing the instruction. Can you move up to double-word variables?

AD really doesn't have a signed 16bit data type, at least not a native one. You can always write the program to interpret the register as a signed word, but the instructions don't handle it for you. If you want native signed numbers, you need to jump to reals.

Brian
 

Similar Topics

In the top bar of directsoft 6 while programming on a DL-262 I noticed a button that says "Select I/O" and it pops up a dialog box asking "old?"...
Replies
1
Views
34
I am not a Automation Direct programmer. I have done a lot of RS500 I have the DS5 software and I am able to look at the program. I am reaching...
Replies
10
Views
1,208
Hello, I have a couple of problems with the directsoft 6 software. I couldn't find a previous answer, and uninstalling and reinstall hasn't...
Replies
4
Views
1,519
Hello all, We have an old AutomationDirect DL405 (CPU 440) PLC, and we've been using DirectSOFT 5.3. Since we are NOT upgrading this PLC for a few...
Replies
6
Views
2,309
Hey everyone, Working on a system with a Koyo DL06 processor and it's my first experience with them. I have DirectSoft 6 and we got the program...
Replies
5
Views
2,408
Back
Top Bottom