Sign in to follow this  
Followers 0
kolonelvonklink

numbersproblem real (newbee)

6 posts in this topic

Hi please take a look at the attachment. all symbols are REALs In VAT1, I modify the variables so the variable straal should become 2. In the FBD FC1 network 2 this variable becomes 2.8026e-45? This I don't understand. so please explain. When I set representation to decimal then this value becomes 2 as it should Also why isn't this functionblock not green? FC1 is unconditionally being called in OB1 where it goes on green and off all the time??? what could be the reason In network 4, why aren't the calculations being carried out (although the are green except the MUL R, why?) PS In DB2 ( symbol: values)I have declared an REAL array: sides array[1..10] real How can I transfert a value there with indirect adressing (with MD10) I don't know the right writing format? PPS if the EN input isn't assigned an input to, is it always carried out then? Thank you very much in advance Stefan Edited by kolonelvonklink

Share this post


Link to post
Share on other sites
You'll found the description of floating point REAL number: http://www.dspguide.com/ch4/3.htm and on attached file. For the MUL R instruction here a cut and paste from the help file: Description A signal state of 1 at the Enable input (EN) activates the Multiply Real instruction. This instruction multiplies input IN1 by IN2. The result can be scanned at output OUT. If either of the inputs or the result is not a floating-point number, the OV bit and the OS bit are set to 1 and ENO is set to 0. So ENO is 0, all variable are REAL? have the code will be helpful to help you on this. Sure thing: ENO is not set so got a error on this instruction. indirect adressing: indirect_variable_names[pointer] for example: DB2_symbol_names.indirect_variable_names[MD10] Real.pdf

Share this post


Link to post
Share on other sites
In short L#2 is not the correct format for floating point. 2.0000E+0 is Your looking at in in Decimal, it should be FP format in the VAT Edited by Groo

Share this post


Link to post
Share on other sites
Indirect addressing requires using the pointer format. For help on formats, when in the editoir click HELP - CONTENTS and then go down to the bottom where the apendices are, one of these goes through all formats including pointer and any formats. In the example above you need to take into account the last 3 bits of the pointer are the bit address (0-7 = 000-111). So for example if you wanted to look at DW10 you would have to do something like L 10 SLD 3 T MD10 L DW[MD10]

Share this post


Link to post
Share on other sites
Thank you for the replies It took me some time to fully understand the REAL format and its representations but I think I've got it. The symbolic indirect adressing though, I can't come to it. Can somebody please rewrite the little program in attachment with statements with symbols. thank you

Share this post


Link to post
Share on other sites
Your program does not work for the reason I stated in the previous answer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0