LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

gfortran

Solved!
Go to solution

labview2014を使用。gfortranでdll(32ビット)を作成しLabview から呼び出そうとしましたが、ライブラリ関数呼び出しノード/test1.vi

でクラッシュします。メモリー番地の不具合みたいなのですが、どうすればいいのかわかりません。どなたかご教示お願いします

Download All
0 Kudos
Message 11 of 18
(337 Views)

LabVIEW側の定数 0 のデータ型が、DBLであることが気になりました。

 

test.png

 

0 Kudos
Message 12 of 18
(321 Views)

singleでもdoubleでも駄目でした

0 Kudos
Message 13 of 18
(298 Views)

Will you show me what yo mean 5 element.  The elements are a,b,sum and product.

So Ithink  elements to bo 4.and all elements are single precision. My code is below

module test_module
use iso_c_binding
implicit none
contains
subroutine test(input_value1, input_value2, sum, product) bind(C, name="test")
real(c_float), intent(in) :: input_value1, input_value2
real(c_float), intent(out) :: sum, product

sum = input_value1 + input_value2
print * ,input_value1,input_value2
print *, "Sum: ", sum
product = input_value1 * input_value2
print *, "Product: ", product
end subroutine test
end module test_module

 

As I wrote before,Fortran is Gnu Fortran newest version. Compile was done 32bit spec..Labview is 2014 32bit

0 Kudos
Message 14 of 18
(294 Views)

Will you show me what yo mean 5 element.  The elements are a,b,sum and product.

So Ithink  elements to bo 4.and all elements are single precision. My code is below

module test_module
use iso_c_binding
implicit none
contains
subroutine test(input_value1, input_value2, sum, product) bind(C, name="test")
real(c_float), intent(in) :: input_value1, input_value2
real(c_float), intent(out) :: sum, product

sum = input_value1 + input_value2
print * ,input_value1,input_value2
print *, "Sum: ", sum
product = input_value1 * input_value2
print *, "Product: ", product
end subroutine test
end module test_module

 

As I wrote before,Fortran is Gnu Fortran newest version. Compile was done 32bit spec..Labview is 2014 32bit

0 Kudos
Message 15 of 18
(254 Views)

As someone who once knew how to program a Card Punch to make "Fortran-specific" punch cards, I can tell you that "Anything FORTRAN can do, LabVIEW can do better" (and, undoubtedly, faster, clearer, and with fewer "Programmer Errors", particularly "spelling" mistakes).  I'm sure your Fortran code is much more complex than adding and multiplying two Reals and printing the results, but I'll wager (my standard stack, a dime, or 10 cents) that it would take less effort to code the Fortran part (I forget what the proper "capitalization" rule is for FORmula TRANslation) (LabVIEW knows a lot of "special functions" ...).

 

Bob Schor

0 Kudos
Message 16 of 18
(267 Views)

voce pode incluir DLL ? 

 

0 Kudos
Message 17 of 18
(258 Views)

Thank you for your link reply. The complex code was the result from CHATGPT. At first

code is very simple but error occured. So  I must seach if the main cause is dll or Labview or combination of them.After 2 days of work,the main cause of trouble may be the transfer of the data between them.But improvement stopped because I can do nothing any more .So I asked someone  for help.

0 Kudos
Message 18 of 18
(238 Views)