HS748 Posted December 9, 2013 Report Posted December 9, 2013 Hello everyone, I've been working with the OpenCockpits USB Output Card. It requires you to use offsets to trigger the outputs. In the panel I'm using, most of the Annunciators depend on L:Vars. Is there a plugin that I can use to "disguise" the LVars as Offsets?
Pete Dowson Posted December 10, 2013 Report Posted December 10, 2013 I've been working with the OpenCockpits USB Output Card. It requires you to use offsets to trigger the outputs. In the panel I'm using, most of the Annunciators depend on L:Vars. Is there a plugin that I can use to "disguise" the LVars as Offsets? Not a ready-made one. It's only a few lines in any case -- just a function called by event.Lvar (thereby supplying it the value), where the given value is written to a user offset (in the range 0x66C0-0x66FF). Choose to write it as UB (8 bits), uW (16 bits), or UD (32 bits), as needed for your value content -- the functions for that are ipc.writeUB, ipc.writeUW and ipc.write.UD respectively. Look them up. Pete
Gypsy Baron Posted December 10, 2013 Report Posted December 10, 2013 In the past I have used the 'user defined' offsets as the 'output' for an internal L:Var. Read the L:Var and write it to the offset. Those offsets are 0x66C0 to 0x66FF The opposite direction can also be implemented...read a user defined offset and send that value to the appropriate L:var. Paul It seems Pete types faster than me :)
HS748 Posted December 10, 2013 Author Report Posted December 10, 2013 Thanks for the help! I'll take a crack at it, see what I can come up with.
HS748 Posted December 10, 2013 Author Report Posted December 10, 2013 Wait, does that mean that I can only write 63 LVars to offsets?
Pete Dowson Posted December 10, 2013 Report Posted December 10, 2013 Wait, does that mean that I can only write 63 LVars to offsets? If you are referring to the 64 bytes of free use offset addresses from 66C0 to 66FF, no. It would only be 64 separate values if each was 8 bits in size (i.e. 8 indicators or a values between 0 and 255 or -128 and +127). At one extreme it could accommodate 512 one bit values, and, at the other, 8 x 64-bit values or double floating point numbers. What do you mean by "only" in any case? Are you planning to construct some add-on which uses thousands of L:Vars ar the same time? Other offsets could be used, at the risk of clashing with other applications you may or may not want to run. If you do such a thing, please do not distribute it for others to use because it would inevitably result in problems which would come my way. If you plan on producing something for general use you need to apply for a range of dedicated offsets just as all other freeware and commercal users of FSUIPC have done. Pete
HS748 Posted December 11, 2013 Author Report Posted December 11, 2013 Don't worry, I have no plans to release anything to the public. I was worried because I would need 74 available offsets. Luckily, there seems to be more than enough.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now