help using double word in Directsoft

dumpsta

Member
Join Date
Aug 2012
Location
ny
Posts
7
Hello

There's a machine that im working on where the operator inputs a number on the touchscreen, the machine makes that number of parts and stops. The problem is that I can't seem to make that input number greater than 4 digits.

Actually on the touchscreen I selected the input to be 32bit BDC. I can actually enter a number greater than 9999, but in the plc program a number of 50000 reads as just 0. Do I have to configure the V memory location as a double word?

Thanks for your help
 
When you use a double the number gets written to the designated 'V' register and to the next one.

For example, if you are writing a BCD double to V2000 the upper part is written to V2001. So an entry of '12345' would result in '1' being written to V2001 and '2345' being written to V2000.

If you do this make sure that the program is using the entry as a double BCD number. Very importantly, make sure that the following V register isn't being used already for something else.
 
I can actually enter a number greater than 9999, but in the plc program a number of 50000 reads as just 0. Do I have to configure the V memory location as a double word?
No, not in the PLC program. The important thing you have to watch for in your PLC program is not to use the 16-bit word address that comes AFTER the start of your 32-bit double word. If the program uses that second part of the double-word address anywhere else. it will overwrite part of your number and make it useless. To view or use the double-word number in the PLC, you will have to use double-word commands such as LDD (Load Double), OUTD (Out Double), ADDD (Add Double), and so on. Most of the DirectSoft double-word commands have a "D" at the end of the instruction.

You DO have to configure the address as a double word in your operator screen program (as you did).
 
Last edited:
ok I'm still having trouble. I'll try to explain in more detail.


v2040 = Touchscreen input field where operator inputs # of parts to be made. (32 bit bcd)


In the plc program, I have rung where i compare this input to the parts actually made, (ct10, or v1010)

v2040 <= v1010 -------- (stop machine)

Now when i click on status, the v2040 will show up as 0. If I open up a data table, v2040 will show up as 0, but if I change the drop down box from word to doubleword, the correct value shows up.
 
but if I change the drop down box from word to doubleword, the correct value shows up.
So your problem is that you are trying to use 16-bit comparisons to check 32-bit numbers. To view or use a 32-bit word, you HAVE to use double word commands or somehow let the PLC know to look at all 32 bits (as you did with your drop-down box), not just the normal 16 bits.

To COMPARE double-word values, first do a LDD to load the first number to the PLC accumulator, then a CMPD (Compare Double) to load and compare a second number with the accumulator, then check the state of one of the Special Relay bits SP60, SP61, and SP62. If SP61 is ON (directly after the CMPD instruction), then the values are equal. If SP60 or SP62 is on, the values are not equal. If SP60 or SP61 is ON, then Value 1 <= Value 2.

Hmmm...I bet you don't have a copy of the manual.

DirectSoft COMPD Compare Double Instruction.jpg
 
Last edited:
I was using boolean comparitive commands from chapter 5-23...from the manual.

Thanks for the reply
 
Try the LDD and the CMPD box instructions from page 5-84 of the DirectSoft User Manual (assuming your DirectSoft PLC allows these commands). After the CMPD, if SP60 or SP61 is ON, then Value 1 <= Value 2.
 
Last edited:

Similar Topics

After replacing the 70 with the 525, the PLC can read from the drive and recognizes it as online, but no commands are being listened to. PLC is...
Replies
1
Views
580
I'm new to Crimson (this is my first week, and I just ran into my first road block. I'm trying to display the position of a rail car, running in...
Replies
3
Views
1,167
Hello, I'm struggling with getting an email to send using an eweb module on a controllogix system. Any chance I could get someone here to help?
Replies
4
Views
1,866
Hi all I am trying to set up a lhttp instruction to connect to an api https (with our IT) this will send data back to the plc? I have an api https...
Replies
9
Views
1,795
please help i didn't solve this problem with rslogix. I counted but i am not using timer. How i will fix this situation? Please anyone solve this...
Replies
18
Views
4,943
Back
Top Bottom