# SIGVIEW - interface with DAQ via JULIA

**URL:** <https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202>\
**Category:** Signal and Image Processing\
**Created:** [December 31, 2023, 7:26am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202 "2023-12-31T07:26:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 7:26am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/1 "2023-12-31T07:26:29Z")

</div>

I am working on a Condition Based Monitoring System for a small Marine Vessel. Need a FFT Software at the end of the line to keep a check on the Diesel Engines.  
I have four sets of Piezo + DAQ to pick up vibrations; 24 bits ADC / 500 Ks/secs. The latter is SPI and I am reading it on a STM32H753 and intend to send data via an Ethernet protocol (I could modify this protocol subject to the software requirement) tied to a LAN switch. Also connected to the LAN switch is a LAPTOP which acts as a server too.  
Need a suitable FFT software to view this data. REAL TIME & record.  
SIGVIEW seems a good choice to start with.  
But there is many a slip between the cup and the lip. I learnt that it could only be done via JULIA.

Contacted SIGVIEW and the reply was;

_To implement your own DAQ protocol, there are 2 options:_

_1. Use Julia-based scripting to create custom signal source window:_

_[Signal source windows](https://sigview.com/help/Signalsourcewindows.html)_

_2. Use File-based DAQ simulation:_

_[Data Acquisition Overview](https://sigview.com/help/DataAcquisitionOverview.html)_

If any one of you could kindly help me to get started in the right direction. I am a Mechanical Engineer / Hobbyist but an avid learner.

Sincerely,

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [December 31, 2023, 8:07am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/2 "2023-12-31T08:07:25Z")

</div>

I don’t know SIGVIEW, but from the linked resource (1) I’d try to use the Julia scripting to create a webserver that listens and stores the incoming data packages in memory via LAN. From this you would need to transform the data into the format as required by SIGVIEW. My first question would be if the scripting interface would generally allow such a long running process to collect the data via Sockets or HTTP.

---

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 8:19am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/3 "2023-12-31T08:19:57Z")

</div>

Good Day Friend,  
To be honest I am new to all this. I had asked SIGVIEW about the Protocol / signal format but that’s what they replied.  
SIGVIEW, supposedly works in real time too so it should support a trail of data.  
I am indebted by your help.  
Apologies can’t be much help.

---

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 8:22am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/4 "2023-12-31T08:22:40Z")

</div>

Since I am employing STM32 downstream of the 24 bits ADC, the format of the data could be well tailored. But what SIGVIEW merits, no idea.

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [December 31, 2023, 8:44am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/5 "2023-12-31T08:44:47Z")

</div>

From what I read you will need to use the two function hooks `update` and `getUpdateIntervalMSec`. The former will provide a `SigviewSignalWindow` object called `output_signal` as a function argument. Based on the example they provide you could use this as a starting point:

```julia
function update( output_signal:: SigviewSignalWindow ) # this is the argument that you will be able to manipulate it is provided by SIGVIEW but you will be allowed to change its properties
# in your implementation you might instead start a server listening on a port and collect the data instead 
  output_signal.samples = rand( -100 : 100, 1000 ) # the `rand` function generates an array of 1000 random values in the range of -100 and 100. The `=` assigns it to the `samples` property of `output_signal`
  output_signal.samplingRate = 10 # here other properties are written 
  output_signal.xAxisUnit = "sec"
  return true
end

```

I think you will need a basic understanding of Julia to follow the example and start making progress on ingesting you own data. To learn Julia you can chose one of the many tutorials: [Tutorials](https://julialang.org/learning/tutorials/)

---

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 9:09am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/6 "2023-12-31T09:09:10Z")

</div>

Thank you ever so much. I do need to get a further understanding of JULIA and must read more. Excuse my naivety, I have been sifting thru the SIGVIEW documents but couldn’t find any info on DAQ interface data.  
Perhaps have to put in more hours.  
Much obliged.

---

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 9:16am UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/7 "2023-12-31T09:16:28Z")

</div>

From the link as under;  
[https://sigview.com/help/Datatypes.html](https://sigview.com/help/Datatypes.html)  
I quote:

- SigviewSignalWindow is probably the most important struct you will use. It describes one SIGVIEW signal window. Please remember that any sequence of values in SIGVIEW is considered to be a “signal”, for example time-domain signal from your sound card, FFT result (spectrum), octave plot,…

Only samples array and samplingRate values are mandatory.  
The above / ARRAY appears to be a .csv type format ie voltages vs time.  
Sampling rate, is undeniably very important. I have it at 500 Ks/sec.  
No idea what SIGVIEW is tolerant with ?  
Sincerely,

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [December 31, 2023, 3:06pm UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/8 "2023-12-31T15:06:41Z")

</div>

The `samples` properties of the `SigviewSignalWindow` is a Julia native array of `Float32` and has no other structure like CSV. See [Single- and multi-dimensional Arrays · The Julia Language](https://docs.julialang.org/en/v1/manual/arrays/) and this tutorial I found on youtube: [https://www.youtube.com/watch?v=-m2ZFPemSUg](https://www.youtube.com/watch?v=-m2ZFPemSUg)

---

<div class="post-metadata">

**Author:** ![Jawad\_Malik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jawad_malik/32/205811_2.png) [@Jawad\_Malik](https://discourse.julialang.org/u/Jawad_Malik)\
**Post date:** [December 31, 2023, 5:46pm UTC](https://discourse.julialang.org/t/sigview-interface-with-daq-via-julia/108202/9 "2023-12-31T17:46:51Z")

</div>

Thank you so much. Shall have a look. Bless you. happy New Year to you.
