07-28-2024 08:57 PM
labview2014を使用。gfortranでdll(32ビット)を作成しLabview から呼び出そうとしましたが、ライブラリ関数呼び出しノード/test1.vi
でクラッシュします。メモリー番地の不具合みたいなのですが、どうすればいいのかわかりません。どなたかご教示お願いします
07-28-2024 09:51 PM
LabVIEW側の定数 0 のデータ型が、DBLであることが気になりました。
07-28-2024 11:11 PM
singleでもdoubleでも駄目でした
07-29-2024 05:09 AM
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
07-29-2024 05:21 AM
07-29-2024 05:09 AM
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
07-29-2024 08:49 AM
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
07-29-2024 10:44 AM
voce pode incluir DLL ?
07-29-2024 06:09 PM
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.