应用笔记 5914

Using the MAX15090/MAX15090B Hot-Swap Solution in Low-Voltage Applications for Resistive Loads

By: Don Corey

摘要 : The MAX15090/MAX1590B are hot-swap controllers designed for a 12V bus and have a unique current foldback feature that ensures the internal FET operates in the safe operating area (SOA) when driving large capacitive loads. This application note outlines a simple way to operate these parts at lower voltages when driving loads that are resistive in nature.

Introduction

Hot-swap controllers must contend with both steady-state and startup conditions. In steady-state operation, the MOSFET used as the controlled switch element must be designed to operate above the maximum current load of the internal FET and maintain junction temperature below the rated maximum junction temperature.

The steady-state power dissipation is basically the product of the square of the load current and the RDS(ON).

PD = ILOAD2 × RDS(ON) (Eq. 1)

Dynamic requirements such as startup must be considered when designing a hot-swap IC with integrated FETs. This is an important consideration when driving capacitive loads that serve as the energy reservoirs for downstream point-of-loads (POLs). The MAX15090/MAX15090B use a technique that monitors the VIN - VOUT difference and uses a current foldback technique to limit the current during startup, which will be discussed in greater detail.

MAX15090/MAX15090B

The MAX15090/MAX15090B ICs are integrated solutions for hot-swap applications requiring the safe insertion and removal of circuit line cards from a live backplane.

The devices integrate a hot-swap controller, 6mΩ power MOSFET and electronic circuit-breaker protection in a single package. These devices implement a foldback current limit during startup to control inrush current lowering di/dt and keep the MOSFET operating under safe operating area (SOA) conditions. This feature is very important at 12V when the load is highly capacitive. Figure 1 outlines the foldback feature during device startup.

Variable speed/bi-level response. This should read startup inrush current foldback characterisics. Figure 1. Variable speed/bi-level response. This should read startup inrush current foldback characterisics.

As shown in Figure 1, the device limits the amount of current to the load based on the VIN - VOUT difference. When the VIN - VOUT difference is 2V or less, the current is limited to RCB/3333.3 × 0.5. If VOUT rises above 0.9 × VIN before the internal 50mS timer times out, the current limit reverts back to RCB/3333.3. To use this part for lower voltage applications with loads that are resistive in nature, the foldback function may prevent the device from actually starting up. For example, for a 3.3V application with a 1.5Ω load, the load current should be 3.3V/1.5 or 2.2A. In this example, with RCB = 10kΩ, the normal current limit is 3A while the foldback current is 1.5A. To exit the startup phase before the internal 50mS timer expires, the output voltage must be greater than 90% of the input to return to the normal current limit of RCB/3333.3. Since 1.5A × 1.5Ω = 2.25V the part will not start up and will never increase the current limit to RCB/3333.3 and will latch off (MAX15090) or retry (MAX15090B).

For low-voltage operation, the current foldback feature is not needed and can be disabled by forcing a voltage on the CB pin. This can be done using a resistive divider on the CB pin. In looking at Figure 2 and examining the current-limit equation of RCB/3333.3, the CB voltage setting should be 12µA × RCB. For this example, to set the current limit to 3A, a 10kΩ resistor will be used. In normal current-limit mode, the voltage on the CB pin is 10kΩ × 12µA or 0.120V.

Setting a fixed current limit by disabling the current foldback feature. Figure 2. Setting a fixed current limit by disabling the current foldback feature.

To minimize the voltage-setting error at the CB pin, the 12µA can be taken into account. For a 3A current limit, ideally 0.120V must be at the CB pin. As such, the current through R2 must be 0.120V/R2. If R2 is equal to 1000Ω then IR2 is equal to 120µA. Therefore, the current from R1 must be 120µA - 12µa or 108µA. So R1 must be 3.3V - 0.120/108µA or 29444. From the standard 1% resistor chart, the closest value is 29400, which provides a nominal error of only 160µV. The bigger error will be derived from the tolerance of the input supply voltage. The tolerance of the resistor-dividers must be taken into account. Since the divider ratio is 29:1, any voltage ripple on the 3.3V power supply will be divided down and should not affect the current-limit threshold.

Limitations

Since the startup current foldback feature is being disabled, there are precautions the designer must consider when using this approach. This application note is intended for low-voltage applications where tradeoffs are made to ensure the MAX15090/MAX15090B stay within the SOA. In normal operation (as soon as the UVLO, UV, and OV thresholds are satisfied), the current foldback circuit becomes active and operates as shown in Figure 1. When the part is starting up and enhancing the internal FET, a 50mS timer is started. If the voltage output is greater than 90% of the voltage input and the gate voltage is at least VOUT + 3V, the current limit shifts to the normal current limit defined by RCB/3333.3. This sequence of events ensures that when the output is connected to high-capacitive loads, the internal FET of the MAX15090/MAX1509B operates in the SOA region. By disabling this feature, the current-limit settings are now defined by VIN × ILIM = 13.5W where ILIM is the current limit set by the voltage applied to the CB pin. Figure 3 is a graphical representation of the current-limit limitation when disabling the foldback feature of the MAX15090/MAX15090B.

Safe operating area when disabling the foldback feature. Figure 3. Safe operating area when disabling the foldback feature.

Two-Level Current-Limit Scheme

Another approach to driving resistive loads is to use the PG signal to switch between two RCB current-limit resistors. As shown in Figure 4, the addition of RCB2 and a small-signal FET 2N7002 (Q1) provides a simple way to increase the foldback current limit on startup but does not eliminate the SOA protection. During the startup phase, the PG signal (see Figure 5) is active-low, which in turn keeps Q1 off and RCB1 sets the current limit during the startup phase. When the voltage output is greater than 90% of the voltage input, the PG signal is pulled up to 3.3V and Q1 turns on, which places RCB2 in parallel with RCB1. As such, during the startup phase, RCB1 sets the foldback current limit and after successful startup, the normal current limit is set by the parallel combination of RCB1 and RCB2.

Referring back to Figure 1, since the maximum foldback current is RCB/3333.3 × 0.5, RCB1 can be set to 2 × RCB/3333.3 to increase the current limit to enable to startup in resistive loads. For example, if the normal current limit is 3A then setting RCB1 and RCB2 to 20kΩ allows for a maximum foldback current limit of 20k/3333.3 = 6A during startup and 20k||20k/3333.3 = 3A for the desired current limit after a successful startup. This technique has also been used for other Maxim Integrated hot-swap ICs with internal FETs. Application note 48721 outlines this technique when using the MAX5976.

Dual-level current-limit control. Figure 4. Dual-level current-limit control.

Current-limit zones with dual -level control. Figure 5. Current-limit zones with dual -level control.

Conclusion

This application note outlines two techniques that can be used when driving resistive type loads with the MAX15090/MAX1509B. Another technique not discussed is to simply use the PG to sequence downstream POLs and other loads that have enable pins. This allows for safely charging output capacitors and ramping up the output voltage while minimizing the inrush current.

References

  1. Maxim Integrated's application note 4872, "Protect Your Integrated-FET Power Switches with Automatic Current-Limit Adjustment"
  2. Dwight Larson. "Selecting n-channel MOSFETs for High-Side Hot-Swap Control." Power Electronics, Nov. 1, 2010. 型号N "); $("#inventoryDetails").removeClass("col-sm-6"); $("#inventoryDetails").addClass("col-sm-12"); } else { var partNumber = encodeURIComponent(part_no); var htmlBulkOrder = "
    " ; $("#buyQuantityDiv").html(htmlBulkOrder); } } } if( sampleJson.canQuote != true ) { $("#requestQuoteDiv").hide(); } if(sampleJson.leadTime == 0 && !(sampleJson.cf == "true" && sampleJson.carrierType == "Tape") ){ if($('#requestQuoteDiv').css('display') != "block") { $('#forLeadtime').removeClass('hidden'); } //$('#quantity5000').show(); } if(maxInventory == 0) { $("#stdleadTime").html('无库存交货期'); } if(params == 'Quote'){ $('#rowDiv').addClass("hidden"); $("#quoteRow").removeClass("hidden"); $("#nonQuote").addClass("hidden"); } else { if(leadTime != "" && leadTime != "undefined" && (parseInt(leadTime) > 0 && parseInt(leadTime) < 98) || parseInt(leadTime) == 0 ){ }else { if(userType != "DISTRIBUTOR") { $('#rowDiv div:not("#inventoryDetails,#requestQuoteDiv, #requestQuoteDiv2")').hide(); if($(".requestQuoteFromBuyCart").css('display') == 'none'){ $("#contactSales").show(); } } } } $('#addToCartP').modal('show'); if (userType == "EMPLOYEE" ) { $(document).find('#qtytobuyText').hide(); $(document).find('#product-quantity').hide(); $(document).find('#addToCartButton').hide(); $(document).find('#employeeMsg').show(); } if(sampleJson.cf == "true" && sampleJson.carrierType == "Tape" && maxInventory == 0){ $("#priceBreak").remove(); $("#orderingquotetext").remove(); $("#quantity5000").remove(); $('#useExistingQuote').remove(); $('#borderid').remove(); $('#inventoryDetails').removeClass('col-sm-6'); $('#inventoryDetails').addClass('col-sm-12'); $('#inventoryDetails').css('padding-left', '55px'); $('#inventoryDetails').css('padding-right', '55px'); $("#sotPartswithnostock").html('非常抱歉,没有足够的库存支持您的需求。因为这种包装类型是由我们的测试人员以卷的形式提供,所以我们只有在有充足库存的情况下,才销售这种类型的产品。目前,只有当我们完成最终测试后还有多余库存的情况下,我们才会在数量小于整卷的情况下,销售该产品。如果您想订购此产品,请将您的订单更改为带和卷的部件号(通常以+T或+T&R结尾),或者与您所在地区的分销合作伙伴联系以获得较小的数量'); } } } else { document.getElementById('buyParams').innerHTML = "Default"; digitalErrorFunction('系统出错,请联系客户支持'); bootbox.alert('系统出错,请联系客户支持'); } } }); var url = "/bin/checkQuoteAvailabilty?partNumber=" + encodeURIComponent(part_no) $.ajax({ url: url, dataType: "json", type: 'POST', async: false, xhrFields: { withCredentials: true }, success: function(data) { result = data; if(result != ""){ if(result.quoteList.quotes.quoteAvailable){ var quoteAvailable = result.quoteList.quotes.quoteAvailable; if(quoteAvailable == "true"){ $("#ortext").removeClass("hidden"); $('#useExistingQuote').show(); } } } } }); if (CQ_Analytics.PersonalInfoStoreMgr.getProperty("isLoggedIn") == "") { $.cookie("redirect","widget"); $.cookie("buy",buy); $.cookie("part_no",encodeURIComponent(part_no)); $.cookie("sampQty",sampQty); if(params == "ProductOrderTab"){ $.cookie("orderTab","true"); } } } else if (buy == "sample" && (CQ_Analytics.PersonalInfoStoreMgr.getProperty("isLoggedIn", true) || CQ_Analytics.PersonalInfoStoreMgr.getProperty("isLoggedIn", true) == "true")) { if(userType == "DISTRIBUTOR" || userType == "EMPLOYEE" ){ window.location.href = "https://shop.maximintegrated.com/backoffice/general/index.php?action=DISTRIBUTOR"; return false; } var userId = CQ_Analytics.ProfileDataMgr.getProperty("email"); var isSampleOrderAllowed = "true"; var sampleMessage = ""; var data = "userId="+userId; $.ajax({ type: "post", url: '/bin/validateSampleOrder', async: false, data: data, success: function(msg) { if(msg.error == "genericerrorText"){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); } else if(msg.status == false){ if(msg.message.match("^Your session expired")){ bootbox.confirm('登录超时,请重新登录。', function(result) { var authorizableId = CQ_Analytics.PersonalInfoStoreMgr.getProperty("authorizableId"); CQ.shared.Util.load("\x2Fbin\x2FLogoutServlet\x3Flanguage\x3Den"+"&authorizableId="+authorizableId); window.location="/cn/mymaxim/login.html"; }); } else { digitalErrorFunction(msg.message); bootbox.alert(msg.message); } } else { isSampleOrderAllowed = msg.output.validateEmailDomain.isOrderAllowed; sampleMessage = msg.output.validateEmailDomain.message; var itemCount = msg.output.validateEmailDomain.itemCount; var orderCount = msg.output.validateEmailDomain.orderCount; if(localStorage.getItem(part_no) == 1) { mycart_widget("sample", function(status){ if(status && typeof _satellite != "undefined") _satellite.track("cart: add"); }); return false; } else { sampleAddToCart(isSampleOrderAllowed, sampQty, part_no, sampleMessage,itemCount,orderCount); } } } }); } else { $.cookie("redirect","widget"); $.cookie("buy",buy); $.cookie("part_no",encodeURIComponent(part_no)); $.cookie("sampQty",sampQty); if(params == "ProductOrderTab"){ $.cookie("orderTab","true"); } gigya.accounts.showScreenSet(aem.login.params); } } } function redirect_rochester(part_no){ var url = 'https://api.rocelec.com/parts/MAX/1?callback=callback&q='+ part_no +'&key=Z3kk1y*'; $.ajax({ type: 'GET', url: url, async: false, jsonpCallback: 'callback', contentType: "application/json", dataType: 'jsonp', success: function(json) { if(json.parts[0] != undefined){ if('permalink' in json.parts[0]){ window.open(json.parts[0].permalink,'_blank'); } else{ digitalErrorFunction('
    Rochester暂无该器件库存,您可以 联系 对方进行采购。如果无法订购,请 联系我们的技术应用工程师 ,他们会帮您寻找可替代型号。
    '); bootbox.alert('
    Rochester暂无该器件库存,您可以 联系 对方进行采购。如果无法订购,请 联系我们的技术应用工程师 ,他们会帮您寻找可替代型号。
    '); } } else{ if(typeof _satellite != "undefined"){ _satellite.track("rochester-popup"); } bootbox.alert('
    Rochester暂无该器件库存,您可以 联系 对方进行采购。如果无法订购,请 联系我们的技术应用工程师 ,他们会帮您寻找可替代型号。
    '); } }, error: function(e) { console.log(e.message); digitalErrorFunction(e.message); } }); } function getDistrbutorInventoryData(partNumber) { if(typeof partNumber != "undefined" && partNumber != "") { var distributors = {}; var distributor_template = Handlebars.compile($("#distributorData").html()); var data = "query="+encodeURIComponent(partNumber); $.ajax({ type: "post", url: '/bin/distributorInventoryComponent', async: true, data: data, success: function(data) { if(data.error == "genericerrorText"){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); } else if(data != null || data != ""){ $('#distributor-loading-image').hide(); if(data != "") { var dataJSON = JSON.parse(data); dataJSON['code']=partNumber; $('#distributor-modal').html(distributor_template(dataJSON)); } } } }); } } function add_to_cart(part_no, buy, params, sampQty,quantity) { var userType = encodeURI(CQ_Analytics.PersonalInfoStoreMgr.getProperty("userType")); if(userType == "") { userType="anonymous"; } var userId = CQ_Analytics.ProfileDataMgr.getProperty("email"); if(params == 'Quote'){ $("#addToCartP").attr('data-quote-id', sampQty.quoteId); $("#addToCartP").attr('data-quote-item-number', sampQty.quoteItemNumber); } if (buy == "part") { var message = ""; var data = "userId="+userId; var isOrderAllowed="true"; $.ajax({ type: "post", url: '/bin/validateRevenueOrder', async: false, data: data, success: function(msg) { if(msg.error == "genericerrorText"){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); } else{ isOrderAllowed = msg.output.validateEmailDomain.isOrderAllowed; message = msg.output.validateEmailDomain.message; } } }); if(isOrderAllowed == "true") { var result; var small_template = Handlebars.compile($("#buyModalBody").html()); document.cookie="mySearchServlet="+window.location+";domain=.maximintegrated.com;path=/"; var servletName = "/bin/SFComponent"; var url = servletName + "?input=single&query=" + encodeURIComponent(part_no); $.ajax({ url: url, dataType: "json", type: 'POST', xhrFields: { withCredentials: true }, success: function(data) { result = data; if(result == "genericerrorText"){ document.cookie="mySearchServlet="+window.location+";domain=.maximintegrated.com;path=/"; digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); }else if (result != "") { if(result.errors != undefined && result.errors[0].message) { document.cookie="mySearchServlet="+window.location+";domain=.maximintegrated.com;path=/"; digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); }else { document.cookie="mySearchServlet="+window.location+";domain=.maximintegrated.com;path=/"; var sampleJson = result; var vol = sampleJson.volumePrices; sampleJson.userType = userType; var noPricingMsg = 0; minQty = sampleJson.min; mult = sampleJson.mult; if(vol != undefined && userType != "DISTRIBUTOR" ) { for (var i = 0; i < vol.length; i++) { var j = i + 1; var vol1 = ""; if (j <= vol.length) { if(vol[i].minQuantity < 1000) { stdPricingFlag = 1; if(j == vol.length) { vol1 = vol[i].minQuantity + "+"; } else { vol1 = vol[i].minQuantity + "-" + vol[i].maxQuantity; } } else if(vol[i].minQuantity == 1000) { vol1 = "1000+"; stdPricingFlag = 1; } else { if(i ==0 && vol[i].minQuantity > 1000) { //vol1 = "No standard pricing available"; noPricingMsg++; delete sampleJson.volumePrices[i].formattedValue; } else { delete sampleJson.volumePrices[i]; continue; } } } else if(j == vol.length && j == 1) { vol1 = vol[i].minQuantity + "-" + 24; stdPricingFlag = 1; } sampleJson.volumePrices[i].minQuantity = vol1; } } maxInventory = sampleJson.stock.atpInv; leadTime = sampleJson.leadTime; if (maxInventory == "" || maxInventory == undefined) { maxInventory = 0; } $('#addToCart').html(small_template(sampleJson)); if(userType != "DISTRIBUTOR") { call(quantity); } } } else { document.getElementById('buyParams').innerHTML = "Default"; digitalErrorFunction('系统出错,请联系客户支持'); bootbox.alert('系统出错,请联系客户支持'); } } }); } else { digitalErrorFunction('系统出错,请联系 客户支持 '); $('#revenuedomainerrordialog').modal('show'); } } else if (buy == "sample") { if(userType == "DISTRIBUTOR" || userType == "EMPLOYEE" ){ window.location.href = "https://shop.maximintegrated.com/backoffice/general/index.php?action=DISTRIBUTOR"; return false; } var isSampleOrderAllowed = "true"; var sampleMessage = ""; var data = "userId="+CQ_Analytics.ProfileDataMgr.getProperty("email"); $.ajax({ type: "post", url: '/bin/validateSampleOrder', async: false, data: data, success: function(msg) { if(msg.error == "genericerrorText"){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); } else if(msg.status == false){ if(msg.message.match("^Your session expired")){ bootbox.confirm('登录超时,请重新登录。', function(result) { var authorizableId = CQ_Analytics.PersonalInfoStoreMgr.getProperty("authorizableId"); CQ.shared.Util.load("\x2Fbin\x2FLogoutServlet\x3Flanguage\x3Den"+"&authorizableId="+authorizableId); window.location="/cn/mymaxim/login.html"; }); } else { digitalErrorFunction(msg.message); bootbox.alert(msg.message); } }else{ isSampleOrderAllowed = msg.output.validateEmailDomain.isOrderAllowed; sampleMessage = msg.output.validateEmailDomain.message; var itemCount = msg.output.validateEmailDomain.itemCount; var orderCount = msg.output.validateEmailDomain.orderCount; if (localStorage.getItem(part_no) == 1) { mycart_widget("sample", function (status) { if (status && typeof _satellite != "undefined") _satellite.track("cart: add"); }); return false; } else { sampleAddToCart(isSampleOrderAllowed, sampQty, part_no, sampleMessage,itemCount,orderCount); } } } }); } } function sampleAddToCart(isSampleOrderAllowed, sampQty, part_no, sampleMessage,itemCount,orderCount) { if(isSampleOrderAllowed == "true"){ if(typeof orderCount != 'undefined' && parseInt(orderCount) >= 1){ bootbox.alert("Maxim规定每个会员可申请的免费样品有数量限制。您的申请数量超过了最大限制。如果您认为此消息有误,请发送电子邮件至 samples-admin@maximintegrated.com 。"); return; } else if(typeof itemCount != 'undefined' && parseInt(itemCount) >= 4){ bootbox.alert("您的样品订单已经超过了最多四(4)行的限制。您可以通过访问我们的 订购页面并搜索产品型号,以购买其他需要的产品"); return; } else{ //var qty = document.getElementById('product-quantity').value; if (sampQty >= 1 || userType == "DISTRIBUTOR" || userType == "EMPLOYEE") { var qty = 1; //taking qty fixed as 5 for sample var data = "input=addtocart&qty=" + qty + "&part_no=" + encodeURIComponent(part_no) + "&CartType=sampleCart&sampleQty="+sampQty+"&usertype="+userType; $.ajax({ type: "post", url: '/bin/cartOperations', async: false, data: data, success: function (msg, textStatus, jqXHR) { if (textStatus == "success") { if (msg == "false") { digitalErrorFunction('数量超过了最大值,请修改数量。'); bootbox.alert('数量超过了最大值,请修改数量。'); return false; } else if (msg.match("^You") || msg.match("^Product")) { bootbox.confirm('登录超时,请重新登录。', function (result) { var authorizableId = CQ_Analytics.PersonalInfoStoreMgr.getProperty("authorizableId"); CQ.shared.Util.load("\x2Fbin\x2FLogoutServlet\x3Flanguage\x3Den" + "&authorizableId=" + authorizableId); window.location = "/cn/mymaxim/login.html"; }); } else if (msg.match("^No orderable unit")) { digitalErrorFunction(msg); bootbox.alert(msg); } else { localStorage.setItem(part_no, "1"); mycart_widget("sample", function (status) { if (status && typeof _satellite != "undefined") _satellite.track("cart: add"); }); } } else { digitalErrorFunction('系统出错,请联系客户支持' + JSON.stringify(msg)); bootbox.alert('系统出错,请联系客户支持' + JSON.stringify(msg)); } } }); } else { digitalErrorFunction('没有足够的样品数量,最多可申请的样品数量为' + sampQty); bootbox.alert('没有足够的样品数量,最多可申请的样品数量为' + sampQty); } } } else { if(sampleMessage =='SAMPLEEMAILDENIAL'){ //bootbox.alert(sampleMessage); $('#sampleemaildenialerrordialog').modal('show'); } else{ $('#domainerrordialog').modal('show'); } //bootbox.alert(sampleMessage); } } $(document).on("click", ".useThisBuyQuote", function () { var quantity = ""; quantity = $('#product-quantityBuyQuote').val(); quantity = quantity.trim(); if(quantity.length == 0){ digitalErrorFunction('请输入数量'); bootbox.alert('请输入数量'); quantity.focus(); return false; } var part_no = $('#Pcode').val(); var quoteId= $(this).data("quote-id"); var quoteItemId = $(this).data("quote-item-id"); $.ajax({ type: "post", url: '/bin/cartOperations', data: "input=addtocart"eId="+quoteId+""eItemNumber="+quoteItemId+"&qty=" + quantity + "&part_no=" + encodeURIComponent(part_no), success: function(msg, textStatus, jqXHR) { if (textStatus == "success") { if(msg.match("^You") || msg.match("^Product")){ if(msg.match("^Your session expired")) { bootbox.confirm('登录超时,请重新登录。', function(result) { var authorizableId = CQ_Analytics.PersonalInfoStoreMgr.getProperty("authorizableId"); CQ.shared.Util.load("\x2Fbin\x2FLogoutServlet\x3Flanguage\x3Den"+"&authorizableId="+authorizableId); window.location="/cn/mymaxim/login.html"; }); } else { digitalErrorFunction(msg); bootbox.alert(msg); return false; } } else if (msg.match("^No Price found")){ //bootbox.alert(msg); digitalErrorFunction('您申请的该型号数量,需要申请报价。'); bootbox.alert('您申请的该型号数量,需要申请报价。'); return false; } else if(msg.match('您申请的该型号数量,需要申请报价。')){ digitalErrorFunction(msg); bootbox.alert(msg); return false; } else if(msg==""){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); return false; } else if(quoteId != "" && quoteId != undefined && ! msg.match("statusCode=success")) { digitalErrorFunction(msg); bootbox.alert(msg); return false } else { $('#useQuoteModal').modal('hide'); mycart_widget(); if ($("#buyParams").html() == "SavedLater") { //alert("Yes inside"); deleteSavedForLater(part_no); } } } else { digitalErrorFunction('系统出错,请联系客户支持'+ JSON.stringify(msg)); bootbox.alert('系统出错,请联系客户支持'+ JSON.stringify(msg)); } } }); }); function call(quantity) { var qty ="",quoteId,quoteItemNumber = ""; if(typeof quantity != "undefined" && quantity !="") { qty=quantity; } else { var value = $('#product-quantity1').val(); if(value != "undefined" && value != "") { qty = value; } else{ qty = document.getElementById('product-quantity').value; } } qty = qty.trim(); var orderInMult = $('#orderInMult').val(); var orderInMin = $('#orderInMin').val(); var inventoryVal = $('#stockAvaliability').val(); var stockAvaliability = $('#stockAvaliability').val(); var cfValue = $('#cfValue').val(); var carrierTypeValue = $('#carrierTypeValue').val(); quoteId=$("#addToCartP").attr('data-quote-id'); quoteItemNumber=$("#addToCartP").attr('data-quote-item-number'); if(quoteId == undefined){ quoteId =""; quoteItemNumber = ""; } if(quoteId != "" && quoteId != undefined){ } else { if(!(cfValue == 'true' && carrierTypeValue == 'Tape')){ if(parseInt(qty) > parseInt(inventoryVal)){ if(qty != "" && orderInMult != "" && orderInMin != "" ){ if(parseInt(qty) < parseInt(orderInMin)){ $('#product-quantity').val(orderInMin); $('#quantity-label').show(); return false; } else if(qty % orderInMult == 0){ $('#quantity-label').hide(); } else { var modvalue = parseInt(qty) % parseInt(orderInMult); var q4 = parseInt(orderInMult)-parseInt(modvalue); var nearestNum = parseInt(qty) + parseInt(q4); //var nearestNum = (Math.round(qty / orderInMult)+1) * orderInMult; $('#product-quantity').val(nearestNum); $('#quantity-label').show(); return false; } } } else if(parseInt(qty) <= parseInt(inventoryVal) && carrierTypeValue == 'Reel'){ if(qty != "" && orderInMult != "" && orderInMin != "" ){ if(parseInt(qty) < parseInt(orderInMin)){ $('#product-quantity').val(orderInMin); $('#quantity-label').show(); return false; } else if(qty % orderInMult == 0){ $('#quantity-label').hide(); } else { var modvalue = parseInt(qty) % parseInt(orderInMult); var q4 = parseInt(orderInMult)-parseInt(modvalue); var nearestNum = parseInt(qty) + parseInt(q4); //var nearestNum = (Math.round(qty / orderInMult)+1) * orderInMult; $('#product-quantity').val(nearestNum); $('#quantity-label').show(); return false; } } } } // Bulk SOT Check if(cfValue == 'true' && carrierTypeValue == 'Tape'){ if(parseInt(stockAvaliability) == 0){ digitalErrorFunction('非常抱歉,没有足够的库存支持您的需求。因为这种包装类型是由我们的测试人员以卷的形式提供,所以我们只有在有充足库存的情况下,才销售这种类型的产品。目前,只有当我们完成最终测试后还有多余库存的情况下,我们才会在数量小于整卷的情况下,销售该产品。如果您想订购此产品,请将您的订单更改为带和卷的部件号(通常以+T或+T&R结尾),或者与您所在地区的分销合作伙伴联系以获得较小的数量'); bootbox.alert('非常抱歉,没有足够的库存支持您的需求。因为这种包装类型是由我们的测试人员以卷的形式提供,所以我们只有在有充足库存的情况下,才销售这种类型的产品。目前,只有当我们完成最终测试后还有多余库存的情况下,我们才会在数量小于整卷的情况下,销售该产品。如果您想订购此产品,请将您的订单更改为带和卷的部件号(通常以+T或+T&R结尾),或者与您所在地区的分销合作伙伴联系以获得较小的数量'); return false; } } } var part_no = document.getElementById('Pcode').value; if(qty.length == 0){ digitalErrorFunction('请输入数量'); bootbox.alert('请输入数量'); qty.focus(); return false; } if (qty % 1 != 0) { digitalErrorFunction('请填正整数'); bootbox.alert('请填正整数'); return false; } var userId = CQ_Analytics.ProfileDataMgr.getProperty("email"); if(CQ_Analytics.PersonalInfoStoreMgr.getProperty("isLoggedIn", true) || CQ_Analytics.PersonalInfoStoreMgr.getProperty("isLoggedIn", true) == "true") { var userType = encodeURI(CQ_Analytics.PersonalInfoStoreMgr.getProperty("userType")); if(typeof quantity != "undefined") { $.removeCookie("redirect"); $.removeCookie("part_no"); $.removeCookie("sampQty"); $.removeCookie("quantity"); $.removeCookie("buy"); } var message = ""; var data = "userId="+userId; var isOrderAllowed="true"; $.ajax({ type: "post", url: '/bin/validateRevenueOrder', async: false, data: data, success: function(msg) { if(msg.error == "genericerrorText"){ digitalErrorFunction('系统出错,请联系 客户支持 '); bootbox.alert('系统出错,请联系 客户支持 '); } else{ isOrderAllowed = msg.output.validateEmailDomain.isOrderAllowed; message = msg.output.validateEmailDomain.message; } } }); if(isOrderAllowed == "true") { $.ajax({ type: "post", url: '/bin/cartOperations', data: "input=addtocart"eId="+quoteId+""eItemNumber="+quoteItemNumber+"&qty=" + qty + "&part_no=" + encodeURIComponent(part_no), success: function(msg, textStatus, jqXHR) { if (textStatus == "success") { if(msg.match("^You") || msg.match("^Product")){ if(msg.match("^Your session expired")) { bootbox.confirm('登录超时,请重新登录。', function(result) { var authorizableId = CQ_Analytics.PersonalInfoStoreMgr.getProperty("authorizableId"); CQ.shared.Util.load("\x2Fbin\x2FLogoutServlet\x3Flanguage\x3Den"+"&authorizableId="+authorizableId); //window.location="/cn/storefront.html"; window.location="/cn/mymaxim/login.html"; }); } else { digitalErrorFunction(msg); bootbox.alert(msg); return false; } } else if (msg.match("^No Price found")){ //bootbox.alert(msg); digitalErrorFunction('您申请的该型号数量,需要申请报价。'); bootbox.alert('您申请的该型号数量,需要申请报价。'); return false; }else if(msg.match('您申请的该型号数量,需要申请报价。')){ digitalErrorFunction(msg); bootbox.alert(msg); return false; }else if(msg.match("^zeroInventoryErrorMsg")){ digitalErrorFunction('非常抱歉,没有足够的库存支持您的需求。因为这种包装类型是由我们的测试人员以卷的形式提供,所以我们只有在有充足库存的情况下,才销售这种类型的产品。目前,只有当我们完成最终测试后还有多余库存的情况下,我们才会在数量小于整卷的情况下,销售该产品。如果您想订购此产品,请将您的订单更改为带和卷的部件号(通常以+T或+T&R结尾),或者与您所在地区的分销合作伙伴联系以获得较小的数量'); bootbox.alert('非常抱歉,没有足够的库存支持您的需求。因为这种包装类型是由我们的测试人员以卷的形式提供,所以我们只有在有充足库存的情况下,才销售这种类型的产品。目前,只有当我们完成最终测试后还有多余库存的情况下,我们才会在数量小于整卷的情况下,销售该产品。如果您想订购此产品,请将您的订单更改为带和卷的部件号(通常以+T或+T&R结尾),或者与您所在地区的分销合作伙伴联系以获得较小的数量'); }else if(msg==""){ digitalErrorFunction('System error occured. Contact customer support for assistance.'); bootbox.alert('System error occured. Contact customer support for assistance.'); return false; } else if(quoteId != "" && quoteId != undefined && ! msg.match("statusCode=success")) { digitalErrorFunction(msg); var msgMatch = msg.match("^Quote compliance not met for quote number (.[0-9]*) as compliance is (.[0-9]%)$"); if(msgMatch){ bootbox.alert('您输入的数量不适用询价编号'+ msgMatch[1] + ',合规数量要求达到' + msgMatch[2]); }else { bootbox.alert(msg); } return false } else if(msg.match('To order this part, you must order the entire inventory of')){ bootbox.alert(msg); return false; } else if(msg.match('We are sorry! Unfortunately, there is not enough excess inventory to support this bulk SOT part request')){ bootbox.alert(msg); return false; } else if(msg.match('A valid quote is required to purchase this part')){ bootbox.alert(msg); return false; }else { $('#addToCartP').modal('hide'); mycart_widget("", function(status){ if(status && typeof _satellite != "undefined") _satellite.track("cart: add"); if(msg.match("entryNumber=1") && typeof _satellite != "undefined"){ _satellite.track("cart: open"); } }); if(quoteId != null && quoteId != "" && quoteId != undefined && msg.match("statusCode=success")){ window.digitalQuoteData = { quoteID : quoteId, quoteQuantity : qty, partNo : encodeURIComponent(part_no) } if(typeof _satellite != "undefined"){ _satellite.track("use-quote"); } } if ($("#buyParams").html() == "SavedLater") { //alert("Yes inside"); deleteSavedForLater(part_no); } } } else { digitalErrorFunction('系统出错,请联系客户支持'+ JSON.stringify(msg)); bootbox.alert('系统出错,请联系客户支持'+ JSON.stringify(msg)); } } }); } else { digitalErrorFunction('系统出错,请联系 客户支持 '); $('#revenuedomainerrordialog').modal('show'); } }else{ $.cookie("quantity",qty); $("#addToCartP").modal("hide"); gigya.accounts.showScreenSet(aem.login.params); } } function redirectBulkOrder(partNumber,quantity){ var url="/cn/storefront/bulk-order.html"; if(typeof partNumber != "undefined" && partNumber != "") { url+="?partNumber="+partNumber; } if(typeof quantity != "undefined" && quantity != "") { url+="&quantity="+quantity; } window.location.href = url; } function redirectToModelN(){ window.open("https://maxim.modeln.com/", '_blank',"width=400,height=150").focus(); } $(document).on('click', '.quoteDetails', function() { $("#useQuoteModal .modal-body").html(""); var index = ""; var quoteNo = ""; var part = $(this).data("part-no"); if(part == "" || part == "undefined") { digitalErrorFunction('请输入购买型号'); bootbox.alert('请输入购买型号'); return false; } if(quoteNo != "" && quoteNo != "undefined") { getQuotesList(part, index, quoteNo); } else { getQuotesList(part, index, quoteNo); digitalErrorFunction('请输入有效的询价单号'); //bootbox.alert('请输入有效的询价单号'); //return false; } }); var useQuoteModalTemplate = $("#useQuoteModalBody").html(); function getQuotesList(part, index, quoteId) { var userType = CQ_Analytics.PersonalInfoStoreMgr.getProperty("userType"); var oldPart = $("#partHidden"+index).val(); //oldpart == part to handle unnecessary quotelists api calls for same part. if(part == "" || part == undefined || part.length < 5 || oldPart == part) { return false; } if(userType == "" || userType == undefined){ $("#modelBuyCartButton").trigger("click"); gigya.accounts.showScreenSet(aem.login.params); return false; } var queryString = "quoteId="+quoteId+"&pendingStatus=&summery=disti&quantity=&materialNumber="+encodeURIComponent(part); var materialNumber = part; var activeFlag = 0; $.ajax({ url:"/bin/QuoteMangementServlet", type: 'GET', data: queryString, success:function(data){ //alert(JSON.stringify(data)); var useQuoteTemplate = Handlebars.compile(useQuoteModalTemplate); var useQuoteJson = {quotesList : [], code : materialNumber, index : index}; if(data.status == false) { var useQuoteJson = {quotesList : [], code : materialNumber, index : index, errorMessage : data.error.errorList.errors.message }; $("#modelBuyCartButton").trigger("click"); $("#quoteLineFlag"+index).val("false"); $('#useQuoteModal').html(useQuoteTemplate(useQuoteJson)); $('#useQuoteModal').modal('show'); digitalErrorFunction(data.error.errorList.errors.message); return false; } else { var quoteListJson = data.quoteList.quotes.quote; } if($.type(data.quoteList.quotes.quote) != "array") { if($.type(quoteListJson.quote_items) != "array") { if(quoteListJson.quote_items.product.code == materialNumber) { var quoteId = quoteListJson.ecom_qt_id_h; var quantity = quoteListJson.quote_items.quantity; //var price = findPriceByQuantity(quoteListJson.quote_items.product.volumePrices, quoteListJson.quote_items.quantity); price = (quoteListJson.quote_items.requote_price * 1).toFixed(3); if(userType == "DISTRIBUTOR") { price = (quoteListJson.quote_items.adj_disti_cost * 1).toFixed(3); quoteId = quoteListJson.modelNQuoteNumber; } var total = price * quantity; total =total.toFixed(3); if(quoteListJson.quote_items.quoteItemStatus == "ACTIVE" && quantity != "" && quantity != "undefined"){ activeFlag = 1; useQuoteJson.quotesList.push({"totalCost":total, "quoteItemId" : quoteListJson.quote_items.code, "status" : quoteListJson.quote_items.quoteItemStatus, "quantity":quantity, "entryNumber":quoteListJson.quote_items.item_num,"quoteId": quoteId, "price": price, "orderCompilance": quoteListJson.quote_items.ordcompliance}); } } else { //return useQuoteJson; //break; } } else { for(var i =0; i