How to convert INT to single SINT?

Hardy81

Member
Join Date
May 2015
Location
Germany
Posts
6
Hey guys,



I'm trying to get a number out of a INT and move it to a SINT.





Source: 2#0000_0001_1100_0010
Dest.: 2#0000_0000


Tried to use a BTD, but it is not working. My SINT stays "0" o_O


Isn't it possible to shift bit 8 of my INT-Tag to bit 0 of my SINT-Tag with a length of 8 bit?




BTD B600_SEW.PE_STATUSWORT 8 B600_SEW.PE_STATUS_CODE 0 8 




So where's the problem? I dont't get it.





TIA


Hardy
 
Hardy,

Not sure of the make, model or revision of PLC you are using, but from the ASCII text (for the BTD instrution) I'm going to guess ControlLogix. If so, your syntax looks good.

Are you by chance not scanning this BTD instruction for some reason?

-Nathan
 
Hello

Using SCL in Tia V14 with PLC sim and 1500 plc I can get the 8 highest bit,s from the 16 bits integer into the 8 bits of the sint using
#uitwoord := SHR(IN := #inwoord, N := 8);

inwoord datatype = int
uitwoord datatype= sint


Regards

Henny
 

Similar Topics

Just curious. Does anyone know the specifics of how the PLC5 converts a single floating point to two integers and back using the COP command? Is...
Replies
3
Views
8,144
Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,379
I have a Structure in my project which has a few nested UDTs. They are ultimately of type DINT. What I would like to do is copy the values out of...
Replies
5
Views
2,248
Thank you so much for your help! I am trying to use an INT or DINT as a setpoint for my remote device using Modbus TCP/IP. My code is...
Replies
2
Views
2,381
Hi guys I have a barcode scannes which gives me some numbers (SINT) that I want to convert into ASCII, so that I can see that ASCII char insted...
Replies
6
Views
2,778
Back
Top Bottom