Simon Posted February 4, 2010 Share Posted February 4, 2010 my plc uses bcd formated analog values. when importing into daqfactory, is there an easy way to convert to integer? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 4, 2010 Share Posted February 4, 2010 Yup. Here is the formula: sum((bcd & {0xf000,0xf00,0xf0,0xf}) / {4096,256,16,1} * {1000,100,10,1}) where bcd is the bcd encoded value. The result is an integer. Link to comment Share on other sites More sharing options...
Simon Posted February 5, 2010 Author Share Posted February 5, 2010 it works perfectly. but it leads me to another question: is this conversion documented somewhere? how could i have found this by myself? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 6, 2010 Share Posted February 6, 2010 The technique used is documented, but the conversion itself isn't. We can't document every possible formula, or every possible application. The manual is already 440 pages long. However, because you were good enough to post the question to the forum, now it is documented for other users. For things not in the manual and not in the forum already, you can just do what you did: ask. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.