# \<formula\> calculations, nonstandard?

**URL:** <https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357>\
**Category:** Uncategorized\
**Created:** [January 11, 2022, 10:37am UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357 "2022-01-11T10:37:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias\_Lindblom](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/tobias_lindblom/32/124_2.png) [@Tobias\_Lindblom](https://aravis-project.discourse.group/u/Tobias_Lindblom)\
**Post date:** [January 11, 2022, 10:37am UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357/1 "2022-01-11T10:37:56Z")

</div>

In the genicam xml code for my camera (FLIR SC7600 infrared cam) there are several calculations for device registers but I do not understand the mathematical expression within the formula tags

example:  
\<Formula\>(SEL = 1) ? 0x0000A050 : ((SEL = 2) ? 0x0000A054 : ((SEL = 3) ? 0x0000BB54 : ((SEL = 4) ? 0x0000BB58 : ((SEL = 5) ? 0x0000BB5C : ((SEL = 6) ? 0x0000BB60 : ((SEL = 7) ? 0x0000A04C : ((SEL = 8) ? 0x0000A058 : (0xFFFFFFFF))))))))\</Formula\>

Any ideas?

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [January 13, 2022, 7:57am UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357/2 "2022-01-13T07:57:30Z")

</div>

Hi Tobias,

It is just an ugly array access.

`output = array[SEL] if SEL in [1..8], 0xffffffff otherwise`

with:

`array = {0x0000A050, 0x0000A054, 0x0000BB54, 0x0000BB58, 0x0000BB5C, 0x0000BB60, 0x0000A04C, 0x0000A058}`

Emmanuel.

---

<div class="post-metadata">

**Author:** ![Tobias\_Lindblom](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/tobias_lindblom/32/124_2.png) [@Tobias\_Lindblom](https://aravis-project.discourse.group/u/Tobias_Lindblom)\
**Post date:** [January 13, 2022, 6:50pm UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357/3 "2022-01-13T18:50:39Z")

</div>

Thanks!  
I am trying to figure out registers on our camera (FLIR/CEDIP, SC7600 ) not in the xml file.  
It has a message channel, needed for additional functionality, but i am unable to get it started and need to figure out a few of the registers that according to wireshark is being written/read to.  
Tobias

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [January 17, 2022, 3:57pm UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357/4 "2022-01-17T15:57:51Z")

</div>

> [@Tobias\_Lindblom](#):
>
> I am trying to figure out registers on our camera (FLIR/CEDIP, SC7600 ) not in the xml file.  
> It has a message channel, needed for additional functionality, but i am unable to get it started and need to figure out a few of the registers that according to wireshark is being written/read to.

Events are not supported yet by Aravis. It would be a nice addition.

It should be quite simple to add, we already have a thread for the heartbeat mechanism that could also handle incoming event packets.

But as usual this work can only be done by reverse engineering.

Emmanuel.

---

<div class="post-metadata">

**Author:** ![Tobias\_Lindblom](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/tobias_lindblom/32/124_2.png) [@Tobias\_Lindblom](https://aravis-project.discourse.group/u/Tobias_Lindblom)\
**Post date:** [February 1, 2022, 12:41pm UTC](https://aravis-project.discourse.group/t/formula-calculations-nonstandard/357/5 "2022-02-01T12:41:10Z")

</div>

FUI:  
UDP payload of these packages from my camera starts with:  
0x420000c2  
then some length, counter and timestamp.  
1 byte per package or just an OK seems to be sent for each write to UART register.  
example  
420000c20014010f00009000ffff00000000000004db484901000000 means “OK or character recieved”

when it starts to transmit a sequence, several packages looking like:  
420000c20018011700009000ffff00000000000004dbc73b020000000200c100  
here the fourth byte from the end is important (0x02) signalling STX  
several more packages follow.

example of characters/numbers response sequence (once the right command have been issues via writes to the UART register):  
0x02 (STX)  
0x0d (length 13)  
0x00 (NUL)  
0x47 ( G )  
0x53 ( S )  
0x4E ( N )  
0x2C ( , )  
0x31 ( 1 )  
0x2C ( , )  
0x31 ( 1 )  
0x35 ( 5 )  
0x38 ( 8 )  
0x39 ( 9 )  
0x34 ( 4 )  
0x32 ( 2 )  
0x2C ( , )  
0xDA (checksum)  
0x03 (EAX)  
message reads

GSN,1,158942  
meaning:  
Get Camera Serial Number, command was understood and executed, serial 158942
