ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert C++ and assembly code

I am just starting this class at my community college and I would like to know how I can convert assemby code from say atmega 8535 assembly code to LabView and C++ the same to Lab View.  I am also trying to come up with a solution to do a final project where I can use my exisiting lab project from one class to LabView it is a A/C  SSR input , output to the atmega and documenting the waveform on a virtual scope on phase and cycle and I don't know how to use the DAQ is there any way you can help me with any of these matters?\Thank you
0 Kudos
Message 1 of 5
(5,193 Views)
What do you mean "convert Assembly to Labview" ?
 
Best regards
Kabanga
0 Kudos
Message 2 of 5
(5,182 Views)

I have recently been doing this type of assembly code to program the chip to manipulate time and phase on ssr ac in and out waveform

is there a way to convert this to labview
;***********************************************************
;DIRECTIVES
;***********************************************************
.include "m8535def.inc"
.def temp=r16
.def delay1=r20
.def delay2=r18
.def time=r17
.def phase=r19
;***********************************************************
;INTERRUPT SPACE
;***********************************************************
rjmp reset   ;reset vector space
rjmp reset   ;external interrupt 0
rjmp reset   ;external interrupt 1
rjmp reset   ;timer/counter2 compare match
rjmp reset   ;timer/counter2 overflow
rjmp reset   ;timer/counter1 capture event
rjmp reset   ;timer/counter1 compare match A
rjmp reset          ;timer/counter1 compare match B
rjmp reset   ;timer/counter1 overflow
rjmp timer_overflow   ;timer/counter0 overflow
rjmp reset   ;serial transfer complete
rjmp reset   ;USART Rx complete space
rjmp reset   ;USART data register empty
rjmp reset   ;USART Tx complete
rjmp reset   ;ADC conversion complete
rjmp reset   ;EEPROM ready
rjmp reset   ;analog comparator
rjmp reset   ;two-wire serial interface
rjmp reset   ;external interrupt request 2
rjmp reset   ;timer/counter0 compare match
rjmp reset   ;store program memory ready
;***********************************************************
;CODE INITIALIZATION
;***********************************************************
;stack initialization
reset:
ldi  temp, low(ramend) ;set up the stack
out  spl, temp  ;""""""""""""""""
ldi  temp, high(ramend) ;""""""""""""""""
out  sph, temp  ;""""""""""""""""

;timer zero initialization
ldi  temp, 0b00000001  
out  tccr0, temp  ;enabling timer 0 for clock
ldi  temp, 0b00000001
out  timsk, temp  ;turning on timer 0 OVF interrupt
sei     ;enabling global interrupt

;i/o set-up area(JUST AN EXAMPLE!!!!!!!)
ser  temp
out  portc, temp  ;initialize lites off
out  porta, temp  ;turn on all pull ups on pin a
out  ddrc, temp  ;make port c an output port
clr  temp 
;***********************************************************
;CODE AREA
;***********************************************************

Main:

sbic  pina,7    ;is switch 6 up?
rjmp  main
in   phase,pina   ;put pina to phase
com   phase    ;change 0's to 1's
cbr   phase,0b10000000 ;clear bit 7 in register called phase =r19
cpi   phase,0    ;compare 0 to phase
brne  loop    

inc phase      ;add 1 more if 0

Loop: 

clr  time
out  tcnt0,time  


;**************************************************************************
;     COMPARISON MODE
;***************************************************************************

Compare:

cp  time,phase   ;does phase = time?
brlo compare

 

;************************************************************************
;    PULSE
;***********************************************************************

sbi  portc,7
rcall debounce
cbi  portc,7
rjmp main

 


;***********************************************************
;DEBOUNCE CALL ROUTINE (20 milli second delay at 4 MEGA Hz)
;***********************************************************
debounce:
ldi  delay1, 30
delay:
dec  delay1
brne  delay

ret

;***********************************************************
;TIMER ZERO OVER FLOW HANDLER INTERRUPT ROUTINE
;***********************************************************
timer_overflow:
inc  time
reti

0 Kudos
Message 3 of 5
(5,173 Views)
There are no assembly or C++ converters to LabVIEW.  If you want LabVIEW VIs which do what the code does, then you will need to rewrite the code in LabVIEW.

If you can compile your C+++ code into a DLL or .NET control, then you can call that from LabVIEW, but the code would still be in C++, you're just having LabVIEW call it.
0 Kudos
Message 4 of 5
(5,170 Views)

I see....sorry, I never do that

Best regards
Kabanga

0 Kudos
Message 5 of 5
(5,167 Views)