LabVIEWwilliam hill官网
直播中

TJsoros

10年用户 95经验值
擅长:嵌入式技术
私信 关注

labview怎么处理dll中的回调函数输出值

本帖最后由 tjauto 于 2019-2-25 08:47 编辑

函数原型
FlashResult Start  ( VFLASHHANDLE  projectHandle, CallbackProgress  callbackProgress,
CallbackStatus  callbackStatus )
函数说明
Parameters:
[in] projectHandle  Handle to the project  
[in] callbackProgress  Function pointer periodically reporting the flash progress in percent and the remaining time in [sec]  
[in] callbackStatus  Function pointer reporting the status of the flash process. The flash process is completed, either if "FS_Success" or an error ("FS_xxx > 0") is signaled  

Returns  VFlashResult Error or success information。

回调函数一
typedef void(* CallbackProgress)(unsigned int progressInPercent, unsigned int remainingTimeInS);
函数说明
Returns  VFlashResult Error or sucallback reporting the flash progress in percent and the remaining time in [sec].
Parameters
[in] progressInPercent Flash progress in percent  
[in] remainingTimeInS Remaining time in [sec]  

回调函数二
typedef void(* CallbackStatus)(VFlashStatus flashStatus);
函数说明
Callback  reporting the status of the flash process. The flash process is completed, either if "FS_Success" or an error ("FS_xxx > 0") is signaled.
Parameters
[in] flashStatus The flash status

C语言中回调函数一和二,直接打印输出
void ReportProgress(unsigned int progressInPercent, unsigned int remainingTimeInS)
{
  printf("Progress: %d%% - Remaining Time: %2d secsr", progressInPercent, remainingTimeInS);
}

void ReportStatus(VFlashStatus flashStatus)
{
  if (flashStatus == FS_Success)
  {
          printf("nReprogramming successfully finished.nn");
  }
  else
  {
          printf("nReprogramming failed (Code: %d)nn", flashStatus);
          PrintLastFlashError(false);
  }
}


请问回调函数一中的参数值progressInPercent, remainingTimeInS,回调函数二中的参数值flashStatus,怎么在labview中作为输出值显示?
dll及头文件见附件,请大神们帮帮忙,万分感谢!

回帖(3)

石秋

2019-2-19 13:41:29
本帖最后由 秋印石 于 2019-2-20 09:10 编辑

·········································································
举报

石秋

2019-2-19 13:51:05
可以用调用库函数节点   选择  互联接口---库于可执行程序---调用库函数节点,然后双击调用库函数节点,配置库函数调用的deLL文件路径设置一下就好了
举报

哈哈哈哈哈咳咳

2022-7-13 17:29:42
大佬,解决了吗,我也需要用labview去调用这个vFLASH,,请问这个怎么解决?跪求!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分